fbpx

Archive

[Solved] Temporary failure in name resolution

DNS errors such as temporary failure in name resolution can easily cripple your server. You will not be able to install any yum packages, you will even not be able to ping google.com, because as you can see this is a name resolution error, which means your server can not resolve domain names to their respective IP Addresses (if you know about DNS, you will know that this is something the whole internet relies on).

 

In this article we will see how to resolve temporary failure in name resolution error, we will discuss various reasons and their respective solutions.


Missing DNS Server IPs

 

Every server needs IP of DNS servers to which they can send their DNS queries. So if IPs of DNS servers are not configured then your server doesn’t know how to resolve domain names to IP Address thus you will end up getting temporary failure in name resolution.

 

In UNIX based system (Linux servers). DNS servers are usually configured in a file called /etc/resolv.conf. So if you don’t have this file or it is empty then you can not resolve domain names, make sure to create one and put the following contents in it:

 

nameserver 1.1.1.1
nameserver 8.8.8.8

 

Network Manager

 

Recently most of the Linux based servers are shipped with NetworkManager. NetworkManager help your connect your server automatically to the internet, for this task network manager auto-generates some configuration files. NetworkManager reads your interface file (eth0 or ifcfg) and then auto-generates /etc/resolv.conf file.

 

Now if you have not defined DNS servers in your /etc/sysconfig/network-scripts file, then /etc/resolv.conf will remain empty, thus you end up getting temporary failure in name resolution error. You can also fix this issue by just populating /etc/resolv.conf file as described above.

 

Also, make sure that in your /etc/sysconfig/network-scripts file set NM_CONTROLLED=no. So that NetworkManager will not update your /etc/resolv.conf file again.

Having issues installing packages on Ubuntu

 

You might see something like

 

Err:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
Temporary failure resolving ‘security.ubuntu.com’
Err:2 http://dl.google.com/linux/mod-pagespeed/deb stable InRelease
Temporary failure resolving ‘dl.google.com’
Err:3 http://mirrors.digitalocean.com/ubuntu xenial InRelease
Temporary failure resolving ‘mirrors.digitalocean.com’
Err:4 http://mirrors.digitalocean.com/ubuntu xenial-updates InRelease
Temporary failure resolving ‘mirrors.digitalocean.com’
Err:5 http://mirrors.digitalocean.com/ubuntu xenial-backports InRelease
Temporary failure resolving ‘mirrors.digitalocean.com’
Err:6 https://repos.sonar.digitalocean.com/apt main InRelease
Could not resolve host: repos.sonar.digitalocean.com

 

This is an example of temporary failure in name resolution error, as apt can not resolve these mentioned domains to their IP Address. Make sure to allow these ports in UFW using the command below :

 

sudo ufw allow out 53,113,123/udp


Restrictions in your Firewall

 

There might also be a firewall restriction preventing your DNS queries. That is why we always recommend installing CyberPanel for free, CyberPanel will open all default ports for you, it will also help you run a super-fast website. Install CyberPanel for free using the install guide. You can also learn how CyberPanel will help you run the super fast website by reading our OpenLiteSpeed vs NGINX article.

 

Let see if this is actually a firewall error by stopping the firewall.

 

Firewalld

 

systemctl stop firewalld

 

Or CSF

 

csf -f

 

Now test and see if your issue is resolved if so, it means that your firewall is preventing your DNS queries.

 

Fix for Firewalld

 

You can add port 53 (UDP) and 43 (whois) to your firewalld. Following commands can be used

 

firewall-cmd — permanent — add-port=56/udp

firewall-cmd — permanent — add-port=43/tcp

 

This will open DNS related ports in FirewallD. If you are using CyberPanel you can easily go to CyberPanel firewalld interface and add these ports without going to CLI.

 

Go to -> https://<IP Address>:8090/firewall/

 

There you can easily open these two ports.

 

Fix for CSF

 

Open file /etc/CSF/csf.conf, then find the line containing TCP_IN and TCP_OUT then add your desired ports. Once your desired ports are added simply restart CSF so that your changes can take effect

 

csf -r

 

To remove any ports, you can just remove those ports from same lines and restart CSF.

 

Again if you are using CyberPanel and you have installed CSF (this will disable Firewalld interface). You can easily go to -> https://<IP Address>:8090/firewall/csf

 

From there you can add your ports and CyberPanel will take care of everything.


Wrong permissions on /etc/resolv.conf file

 

In some rare cases it is possible that your resolver file have wrong owner or permissions, execute following commands to implement correct permissions

 

chown root:root /etc/resolv.conf

chmod 644 /etc/resolv.conf

 

This should fix any permissions related issues with the resolver file.


Conclusions

 

I hope by now you have a general idea of what actually is a  temporary failure in name resolution error, because to fix any error we first need to know what actually it is. Then we’ve also discussed various ways to fix this error in different situations.

 

If you are a system administrator, then the first rule to solving any problem is stay calm and debug the problem. However, if you don’t have much time and looking for experts to manage your server, you are in the right place, you can hire our managed vps service. We offer 3 days free trial (no credit card required).

[Solved] Disk Quota Exceeded

Disk Quota Exceeded is very scary and common linux error in web hosting servers. When this happen you as a website owner may fail to restart mysql database, fail to upload file or even failed to restart your web server if it is down.

 

Generally it looks like you exceeded your alloted disk limit or your overall disk space is full as the error message is very obvious (Disk Quota Exceeded) meaning you reached the limit of your disk quota assigned to you.. Due to which various services like MySQL database and web server can’t start as they need to create files for their proper functioning. We at CyberHosting use CyberPanel control panel, if you are using CyberPanel you can easily see disk space usage on your dashboard after your login.

 

We recommend CyberPanel for self-managed VPS as well, because it helps you to manage most of the things within few minutes, otherwise you could be spending lots of time doing the same thing. You can start using CyberPanel for free with just one install command, for more details visit the installation page.


Why you see Disk Quota Exceeded error?

 

If you are a website owner, and running a managed or self-managed VPS. There are 99% chances that you must have configured some sorts of backups and logging as well (logs generated by different application, to debug any issue in case something funny happens later). So there are some example of files that could be using extensive disk space and you don’t know about them:

 

  • Large old backup files residing on the server that you have not deleted.
  • Large log files from web server or any other applications that you have not deleted after they are rotated by the application.
  • Some un-used applications or staging setups that you did during developent.
  • Spam or deleted mail folders still containing large amount of emails that you don’t know off.

 

All these files could occpuy large amount of space ending up causing disk quota exceeded error.


Lets first find out large directories and files

 

We will first try to find out large files and directies in your server, you can then decide if those files  are safe to be deleted, ending up giving you more space.

 

cd /home

du -hs * | sort -rh | head -20

 

These command will print out large files and directories under /home directory of your server. You can then figure out what directories can possibly contain files that are not needed. Similary you can run this command under various directories such as /var/log

 

Make sure you don’t something which is important, and if you don’t know what you are doing, then it is better you let our experts do the work by hiring our managed vps or monthly support package we offer 3 days free trial (no credit card required).

 

If using CyberPanel

 

As mentioned above we recommend CyberPanel for managing your day to day server tasks, so if you have already  decided to use CyberPanel. Look for following directories as they must be containg large backup files that you won’t need.

 

/home/domain.com/backup

/home/backup

/usr/local/lsws/logs


Exceeded number of inodes (file entries) supported by your choosen file system

 

There is a possibility that you still have enough disk space left, but you reached inodes limit end up giving disk quota exceeded. First make sure you that you have enough space left.

 

Filesystem Size Used Avail Use% Mounted on
/dev/vda1 25G 6.9G 19G 28% /

 

You can see that disk space is only 28% used. Now check if you reached inodes limit.

 

df -i

Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/vzfs 2000000 2000000 0 100% /

Now this means you have reached 100% of your inode usage. It is time that you delete smaller files that are no use to your applications. For example find large number of small files under /var

 

find /var -type d -size +256k

 

Similaly you can find small files under /home as well, and delete files to resolve disk quota exceeded error. Some type of files that you can easily delete are:

 

  1. Cache files generated by servers (LiteSpeed Server use disk for cache). Incase of LiteSpeed cache folder is created under home of each user.
  2. Sessions files generated under /tmp and not being deleted.
  3. Catch all email inbox may have 1000s of emails you don’t need to keep, so they can be easily discarded.

 


Easy way to clear some space if you are using CyberPanel

 

As adviced by us, if you are now using CyberPanel, there are some easy way to free up disk space safely.

 

Remove OpenLiteSpeed Cache folder

 

rm -rf /usr/local/lsws/cachedata

 

Remove Cache folders when using LiteSpeed Enterprise

 

rm -rf /home/domain.com/lscache

 

You can do this for every domain. (By replacing domain.com with your domain)

 

Delete Backups

 

rm -rf /home/domain.com/backup/*.tar.gz

 

You can do this for every domain. (By replacing domain.com with your domain)

 

You can also do

 

rm -rf /home/backup/*

 

Remove old CyberPanel versions

 

rm -rf /usr/local/*.tar.gz


Conclusion

 

We’ve discussed many reasons and their fixes related to disk quota exceeded error.  If you are still stuck at some point and don’t have much time or expertise to fix this issue, you can contact us to get help.

 

Sometimes it may just be a limitation imposed by any control panel you are using, and you could be losing important business emails due to this. So while you are fixing and debugging the cause, it is better to increase disk limit size for your accounts or mailboxes, so that you won’t lose important stuff.

 

How to resolve “localhost connection refused”?

When on windows you usually use putty to connect to remote SSH servers or terminal when on Linux. While connecting sometimes you can get error such as localhost connection refused on putty or your Linux terminal. Now, this can be very annoying as you can’t get to SSH of your remote server and perform your tasks.

 

This problem can be from the server or client-side. In this tutorial, we will see probable causes of this error and how to fix them. If you are using our managed vps, then you just have to contact us via ticket or live chat and we should fix this for you.

 

Let’s continue and see reasons for this error and how to resolve localhost connection refused.


Possible error messages on Putty or Linux Terminal

 

We will first see possible error messages that you will see.

 

In putty

 

Putty Fatal Error
Network Error: Connection Refused

On Linux Terminal

 

ssh: connect to host 51.xx.xx.xx port 22: Connection timed out

 

Now the connection to the server is properly routed, but the server is not accepting your connection for many reasons that we will discuss below.


Reasons and Fixes for localhost connection refused

 

We will now discuss reasons and fixes for this error one by one.

 

1. SSHD Daemon not running

 

It is possible that SSHD daemon on your remote server is not running. For SSH to work there is a daemon that works behind the scene and it is called SSHD. If this daemon is not running your server will not be able to accept SSH incoming connections. Check if this service is running or not:

systemctl status sshd

If it is not running you can turn it on:

systemctl start sshd

 

SSHD does not start?

Now for some reasons if your SSHD daemon still won’t start make sure you have enough disk space using:

 

df -h

 

If you have enough space you can see if your server is receiving heavy traffic or if the server is under heavy load. You can hire our managed vps service as well we offer 3 days free trial (no credit card required)

 

2. Firewall blocking SSH Port

 

Most of the time there is some firewall blocking the SSH port. First, see if you can telnet to SSH port 22

 

telnet 192.xx.xx.xx 22

 

Then check if you or user IP is blocked on IP Tables firewall

 

iptables -nL

 

If IP is listed, you need to unblock this IP to restore connectivity to SSH port 22. There is also a possibility that firewall has dropped or reject rule for SSH port 22, you need to remove that rule and add run following command:

 

iptables -A input -p tcp –dport 22 -j ACCEPT

 

If using CyberPanel

 

If you are using CyberPanel it comes with Firewalld by default unless you have installed CSF. You can go to :8090/firewall/ by default port 22 is opened, if not you can add port 22 there.

 

If you have installed CSF with CyberPanel, you can use csf.allow file to allow this IP. The file is located at

 

nano /etc/csf/csf.allow

 

Then turn off and turn on CSF again from CyberPanel interface.

 

3. Custom SSH Port

 

If you have defined a custom port for SSH (for security reasons, because standard SSH ports are prone to brute force attacks). Then you need to open that port on the firewall as well. Because firewall doesn’t know you choose a custom port for SSH.

 

First, confirm if you are using custom port using

 

cat /etc/sshd_sshd_config | grep Port

 

If you see something other then port 22, you need to fix it.

 

iptables -A input -p tcp –dport custom_port_here -j ACCEPT

 

Replace with custom port here.

 

If using CyberPanel

 

Go here :8090/firewall/secureSSH and see if you have set custom ssh port. Normally if you set custom SSH port, CyberPanel will open this port for you on the firewall. But if it still does not work, you can open this port manually by going to :8090/firewall/ or here :8090/firewall/csf if you are using CSF.

 

4. Incorrect IP, SSH Port or Key File

 

It is also possible that you did a human error and used incorrect IP or wrong SSH port. Make sure you are using right IP on putty or Linux terminal along with correct SSH port.

 

Sometimes people also use key-based authentication, and they get issues while connecting to SSH if the wrong private key is used or there are wrong permissions on your SSH private key. On your local server make sure that your private key has the permission of 600.


Why use CyberPanel?

 

We’ve discussed many reasons and fixes for localhost connection refused error. But we recommend that you install CyberPanel on your VPS, it will help you solve many issues and if you are hosting sites then you will get super speed as well because CyberPanel is based on OpenLiteSpeed and LiteSpeed Enterprise.

 

You will get easy access to Firewalld (installed by default) where you can easily open/close any ports at your wish. Or you can also install CSF too.

 

If you are very novice user you can also hire our managed vps service, we are super affordable and provide top-notch support to all our customers. You can start with 3 days trial (no credit card required at all).

FTP 550 No such file or directory

FTP (File Transfer Protocol) is a standard network protocol used to transfer files between clients and servers. It is the fastest way to upload your file on the server. If you are using CyberPanel, you can also use File manager, but it is always recommended to use FTP to transfer large files to your server. However, as with any other software people face an issue with FTP as well. In this tutorial will discuss one FTP error called ‘FTP 550 No such file or directory’. This means file or folder does not exist.  Today will see what are the main reasons behind this error and how to fix them.

 

However, if you are our customer and use our managed vps service, feel free to contact us via helpdesk to get this issue resolved.

 

What is FTP 550 No Such File or directory

 

We will first see what actually is FTP 550 No Such File or directory error.

 

5xx errors with FTP means complete rejection from the server. Which means that your FTP client such as Filezilla sent an FTP command which remote server fails to accept and returns with 5xx families of error.

 

It is also related to File system issues, for example, the FTP users do not have access to the folder you are trying to access or upload content too.

 

What is the main cause of this error

 

1. Wrong Permissions 

 

If your folder or files have wrong permissions this will also cause ‘FTP 550 No such file or directory’. This happens when the user does not have enough privileges to edit or open file they are trying to access. So if you are using CyberPanel avoid uploading files via root SFTP account, because those files will then be owned by root account and you can then can’t access those files via FTP.

 

If you have already done so, make sure to click Fix Permissions from the file manager. Or you can log in to ssh via root, then first find out the user of your website by running:

 

ls -la /home

 

This command will tell you the owner of the directory who owns your document root, you can then run following commands to change owners of your document root

 

chown -R user:user /home/domain.com

 

Also, this status code occurs when you try to GET a file that does not exist.

2. Incorrect Path 

 

FTP 550 No such file or directory can also occur if you are trying to upload file to an incorrect path.  Such as if the file is present in the document root of your site at /home/domain.com/public_html and you are trying to upload from /home.

 

The easiest way to get around the incorrect path is to logout from FTP, and log in again. You will then land in the default FTP folder and from there you can easily navigate to the folder you want to upload file to.

 

3. Wrong Mount Point 

 

Sometimes users mounts filesystem at a certain mount point but they don’t configure it to retain after reboot. So after server reboot that mount point does not exist anymore. In such case when they login to that FTP account they usually see 500: No such file or directory, because that mount point does not exist anymore.

 

Make sure to remount the file system and make it persists during the reboots.

 


How to Create FTP Account In Cloud Platform

 

 

Once the website is created, click on your service ID. You will be brought back to the page where you can manage your sites created in the CyberPanel.

 

 

Click the launch icon.

 

 

From the left sidebar, click Create FTP Account under FTP. Fill in all the details and click Create FTP button. You can leave the path empty and default path will be used which is usually document root of the website (i.e. /home/domain.com). But if you set some path such as helloworld the final path will be relative to document root such as /home/domain.com/public_html/helloworld.

 

FTP Account is necessary to upload your website/application files. But if you are going to use our Auto Installer creating FTP account is not really necessary.

 

You can also use default File Manager of CyberPanel to manage files of your website, but for large uploads, FTP is recommended.

Plesk Alternative: CyberPanel! Hosting Control Panel for LiteSpeed

We’ve recently discussed CyberPanel as viable cPanel alternative. Plesk is another popular control panel used by many out there. But if you are here, it means you are already looking for its alternative. There can be various factors/reasons for you looking for Plesk alternative.  Such as:

 

  1. Pricing: Plesk has mid-range pricing. But still some people out there can’t seem to afford, and then they start to look for an alternative.
  2. Complexity: Plesk is a complex control panel, for first-time users it can be confusing due to lots of options provided.

 

There can be many other factors as to why you look for a Plesk alternative. As we’ve talked in our cPanel alternative article, we are again going to talk about why would you choose CyberPanel over Plesk. We are not going to talk about the faults in Plesk here, as any software has pros and cons. But since you are here looking for Plesk alternative, we will see why you can use CyberPanel and still get same features plus slightly better performance due to native support for OpenLiteSpeed and LiteSpeed Enterprise (comes with CyberPanel Enterprise).

 

CyberPanel is free

 

Yes, you heard is right, even though there is a pricing page on CyberPanel. Many people think that CyberPanel only has paid options. However that is not true, CyberPanel has a free version that comes with OpenLiteSpeed web server. Now your mind will start asking questions what is the difference between the free and paid version of CyberPanel.

 

Difference is server that comes pre-installed. When you install free version of CyberPanel you get OpenLiteSpeed, and when you install CyberPanel Enterprise, you get LiteSpeed Enterprise Web server included already in the cost.

 

But then you need to understand the difference between OpenLiteSpeed vs LiteSpeed Enterprise. Now that you have got a better idea of the difference between these servers, you will have a clear picture of what version of CyberPanel you want to choose.

 

Now that is the only difference between free and paid CyberPanel, apart from that 100% is same. You get the same working and features in both free and paid versions. Now if you want to set up CyberPanel and get started with it, you can read our cPanel alternative article as it explains how you can easily get started with CyberPanel. We will take a little different approach in this article and leave out the technical details for cPanel alternative article, you can go down there and learn the technical points. However, in this article we will see that how for different kind of sites CyberPanel fits perfect compared to Plesk and weather you will be needing paid or free version of CyberPanel.


CyberPanel as Plesk Alternative for WordPress

 

If you go down at W3Techs to see WordPress usage statistics. You can see WordPress usage as a content management system, right now at the time of this writing WordPress is used by 60.8% of all the websites whose content management is known to W3Techs. Now 60.8% is a big number. Which means that out of 100 people using CyberPanel there is a higher chance that they will be running WordPress sites.

 

Plesk have a WordPress toolkit to help you with WordPress related tasks. But if you see on CyberPanel side you get free of cost WordPress one-click installer, that not only installs WordPress but also installs LSCache plugin for you, which means your site is ready to be super fast as the default web server is OpenLiteSpeed (when you use the free version of CyberPanel).

 

For Bloggers

 

If you have blogging sites, then the free version of CyberPanel will be good for you. Because blogging does not require ESI caching which is only available with LiteSpeed Enterprise. So this is the best case where you can use CyberPanel for free.

 

For WooCommerce Shops

 

Shopping sites usually require ESI hole punching with their caching, so here you would need CyberPanel Enterprise (thus getting LiteSpeed Enterprise with ESI hole punching).

 

If you are not convinced, you can go here and see the performance of openlitespeed vs nginx. You can clearly see that OpenLiteSpeeds easily outperforms NGINX in most cases especially with WordPress. On top of that LiteSpeed Enterprise is even faster then OpenLiteSpeed.


CyberPanel as Plesk Alternative for Developers

 

Developers can also use CyberPanel in their development lifecycle. If you are a developer and use GIT version control in your development environment, then CyberPanel got you covered. You can attach your GIT repositories to CyberPanel website and set up webhooks so that CyberPanel can update your code with each push. Following providers are supported:

 

  1. Github
  2. Gitlab

 

To get started you first need to create website in CyberPanel. Once a site is created you can go and manage this site -> Websites -> List Websites -> Manage. You will land on a website launcher, there you can click Git on bottom of the page.

 

 

First, you need to deploy your key to Github.

 

 

You need to add this key to your account level.

 

Github

 

To attach the key on Github visit -> https://github.com/settings/keys

 

Click New SSH Key and then add the key that you found from the box above.

 

Gitlab

 

To attach the key on Gitlab account visit -> https://gitlab.com/profile/keys

 

Once keys are added come back to CyberPanel and attach your repo.

 

Attaching Repo

 

 

  1. In box 1, you need to enter the username of your Github/Gitlab account.
  2. In box 2, enter your repository name.

 

This also works with prviate repositories, just make sure to add key properly. You can also select the branch to be attached.

 

Setup Webhooks

 

If you want to auto-update code on CyberPanel after every code push to your repo, you need to set up Webhook, so that your code is properly synced between CyberPanel and your repository.

 

Github

 

To setup webhook on Github visit https://github.com/username/reponame/settings/hooks

 

Replace username and repo name accordingly. Click Add New Hook.

 

  1. Payload URL -> https:/<Server IP>:8090/websites/cyberhosting.org/gitNotify (Replace server IP with actual server IP or hostname).
  2. Content-Type -> Application/JSON
  3. SSL verification -> Disable SSL verification if you not issued hostname SSL and used hostname instead of IP in webhook URL.

  4. Which events would you like to trigger this webhook? -> You can select anything, normally just select the push event.

 

And finally, click Add webhook. Now whenever you push code changes to your repository, it will be auto-synced to CyberPanel website that you have attached your repo too.

 

Gitlab

 

To setup webhook on Github visit https://gitlab.com/username/reponame/-/settings/integrations

 

Replace username and repo name accordingly.

 

  1. URL -> https:/<Server IP>:8090/websites/cyberhosting.org/gitNotify (Replace server IP with actual server IP or hostname).
  2. SSL verification -> Disable SSL verification if you not issued hostname SSL and used hostname instead of IP in webhook URL.

  3. Trigger for push events only.

 

And finally, click Add webhook. Now whenever you push code changes to your repository, it will be auto-synced to CyberPanel website that you have attached your repo too.


CyberPanel as Plesk Alternative for DNS only Servers

 

You can install CyberPanel as DNS or even Mail Only. To install as DNS only run this command

 

  1. sh <(curl https://cyberpanel.net/install.sh || wget -O – https://cyberpanel.net/install.sh)

 

 

  1. First, it will ask if weather to install CyberPanel or Addons. You can enter 1 to install CyberPanel.
  2. It will then ask Install CyberPanel with OpenLiteSpeed or LiteSpeed Enterprise, now that is totally up to you.
  3. Next, it will ask to Install minimal service for CyberPanel? You need to answer no here, because it will then skip installation of Email, DNS and FTP server. But we want to install DNS server, so you have to choose yes here.
  4. It will then continue to ask whether you want to install Postfix, DNS and FTP servers select no for all except for DNS server.

 

Once the installation is completed, you can then use CyberPanel as DNS only. Similar you can also use for Mail only, if you choose not to install some components, these components will not show up in the CyberPanel interface.

[Solved] HTTP Error 503. The service is unavailable

HTTP Error 503. The service is unavailable

Web servers such as LiteSpeed and Apache use various codes to tell browsers about responses. For example, if the web server replies back with HTTP code 200, it means that everything is fine and the response generation was successful. There are many other response codes, but today we will discuss HTTP Error 503, and when this usually happens you get following error on your browser: HTTP Error 503. The service is unavailable.

 

If you are not the administrator of the site, there is nothing much you can do as mostly this error indicates that there is something wrong on the server side. You can either refresh the page, visit later or better notify an administrator of the site. However, if you are the administrator of the site, you can do much to figure out what is wrong and there are various reasons and ways to fix this error. There are multiple web servers, each may give you a slightly different error message, such as:

 

  1. 503 Error
  2. Http/1.1 Service Unavailable
  3. 503 Service Temporarily Available
  4. 503 Service Unavailable
  5. HTTP Error 503
  6. Service Unavailable – DNS Failure
  7. Error 503 Service Unavailable

 

Usually, the main thing to look for is error code which is HTTP error code 503. Today we will see how we can discuss various reasons and respective ways to fix the issue.

 

Server Side Issue

 

Before deep diving into various reasons as to why this could happen, I would again like to mention that this is a server side issue. All errors in the 5xx range are considered errors on the server side including 503 Service Unavailable Error. However do keep in mind that 503 error means the server was able to process your web request and it was functioning properly but it chooses to return 503 error code because due to some problem/issue server is not able to process this request the way it should have.

 


Refresh the page

 

Some times you will get the following error

 

503 Service Unavailable – The server is temporarily busy, try again later!

 

 

 

It may really be a temporary error as the error message says, so wait some time and refresh the page. This can happen to high traffic sites, where enough resources are not available to handle the request. On the user end, be careful if you are seeing this error on the payment related pages, and make sure you won’t get charged twice.


Using our Apache as Backend Feature

 

If you are our customer and using our Apache as Backend feature, there is a chance that Apache is down. In this case frontend server which is OpenLiteSpeed, will give you 503 error, as it is failed to connect to Apache. See if Apache is running

 

systemctl status httpd

 

If Apache service is not running, you can start with

 

systemctl start httpd

 

And see if your issue is resolved.

 

PHP FPM is down

 

If you get something like (Assuming you are using our Apache as backend feature or your stack includes PHP-FPM)

 

Service Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

 

This means your PHP-FPM service is down. You can start php-fpm using

 

systemctl start php-fpm

 

In case you are our customer, there are multiple PHP-FPMs are available for different PHP versions and their respective commands are:

 

systemctl start php54-php-fpm

systemctl start php55-php-fpm

systemctl start php56-php-fpm

systemctl start php70-php-fpm

systemctl start php71-php-fpm

systemctl start php72-php-fpm

systemctl start php73-php-fpm

 


Check various log files

 

If your issues are still not resolved, you can start to check various log files. In the case of CyberPanel and LiteSpeed (OpenLiteSpeed), log files to check are:

 

/usr/local/lsws/logs/error.log

/usr/local/lsws/logs/stderr.log

 

In the case of Apache

 

/etc/httpd/logs/error_log

 

You can do an efficient search of log files using the grep command such as:

 

cat log_file_path | grep error

cat log_file_path | grep notice

 

This command will make sure that you only get the most relevant information, otherwise, you may also get info level messages in your log files and they are not relevant in this case.


503 Errors due to PHP Malfunction

 

Most of the times 503 errors can come due to a problem in your PHP code, or either PHP-FPM/LSPHP are not able to produce response thus server started giving you 503 error. It is always recommended to first create a phpinfo page and see if your PHP side is working fine. If you can see the phpinfo page, you can move forward to further debug the cause, otherwise, make sure LSPHP is working fine and external application is created properly or PHP-FPM is up and running.

 

Disable PHP OPCode Caching (xCache, ACP or eAccelerator)

 

On a default install of CyberPanel (OpenLiteSpeed or LiteSpeed Enterprise), OPCode caching is enabled. Sometimes different sorts of opcode caching can have compatibility issues with LSPHP (PHP). So if you are getting HTTP Error 503 Error better try to disable opcode caching. On CyberPanel you first need to find out which PHP version is used by your site. To find out your PHP version on CyberPanel run the following command

 

cat /usr/local/lsws/conf/vhosts/yourdomain.com/vhost.conf | grep php

 

For example, the PHP version of your site is 7.2. Go to the configurations directory of PHP 7.2 and disable opcode caching.

 

cd /usr/local/lsws/lsphp72/etc/php.d

mv 10-opcache.ini 10-opcache.ini.bak

systemctl restart lsws

or

/usr/local/lsws/bin/lswsctrl restart

 

This will disable OPCode caching. If you are not on CyberPanel, you need to find the php.ini file for your PHP and disable OPCode caching. Usually, php.ini location is disclosed in phpinfo page. If your issue is still not resolved, you can move on to the next step.

No space left on /tmp

 

Some web application use /tmp directory to store temporary files (session data etc). If /tmp is full you can get HTTP Error 503 Error. Use the following commands to inspect /tmp directory space

 

df -h

df -i

 

 

PHP memory_limit reached

 

memory_limit is a php directive that specifies how much memory a PHP script is allowed to allocate. Sometimes your application might be exceeding this limit, thus failed to produce response for the web server resulting in HTTP Error 503 Error. As explained above, first find out the PHP version used by your site. Then you can directly increase memory_limit from CyberPanel interface.

 

Login to your CyberPanel Dashboard then from left sidebar PHP -> Edit PHP Configs

 

 

  1. Select PHP version to change the value of memory_limit directive.
  2. Set the new value of the directive.

 

Finally, scroll down and click Save Changes.

 

max_execution_time reached

 

max_execution_time is similar to memory_limit. So if your PHP script exits early without producing response again you will get the same error. You can follow the same procedure as described above to fix max_execution_time as well. Make sure to set it to a high enough value so that your script is properly executed.


Conclusion

 

We’ve pretty much discussed all the possible causes of “HTTP Error 503. The service is unavailable”. However we recommend moving your sites to CyberPanel, because CyberPanel use LiteSpeed servers. Which means in low cost VPS you can host more sites, and using LSCache WordPress plugin you can avoid many such errors including HTTP Error 503. Because if your pages are cached, PHP engine is not used, thus giving other applications more resources to run. So in a low cost server you can run multiple sites at super fast speed and avoid such errors. You can learn in our OpenLiteSpeed vs NGINX comparision post as to why you would use CyberPanel and OpenLiteSpeed.

 

You can also get our managed vps and let us do this for you. We offer 3 days trial (no credit card required, plus free migration and fully managed support)

cPanel Alternative: CyberPanel! Hosting Control Panel for LiteSpeed

cPanel has been around for ages, there are many people using cPanel but due to its cost, they are always looking for cPanel alternative. There are hundreds of cPanel alternatives out there but today we will talk about CyberPanel. CyberPanel not only is a great cpanel alternative, but it is super fast as well. Sites running on CyberPanel are fast, as CyberPanel use OpenLiteSpeed as a server in the free version and LiteSpeed Enterprise Web Server in the paid version.

 

CyberPanel is super easy to use due to its user-friendly GUI (Graphical User Interface). According to current users, the learning curve is not very hard when they shift to CyberPanel. CyberPanel have 2 variants, one is free and other is paid. We will first learn the difference below.

 

CyberPanel for free

 

The free variant of CyberPanel comes with OpenLiteSpeed. Apart from that, it is 100% the same as the paid version of CyberPanel except for the containerization feature. However, if you are using CyberPanel for personal use, containerization feature does not make sense to you.

 

CyberPanel paid or CyberPanel Enterprise

 

The paid version of CyberPanel comes with LiteSpeed Enterprise Web Server. At the time of this writing, there are only a few differences between OpenLiteSpeed and LiteSpeed Enterprise. Let’s discuss them below:

 

  1. LiteSpeed Enterprise have ESI (hole punching)
  2. QUIC (QUIC is planned to be included in OpenLiteSpeed as well)
  3. Full .htaccess support, whereas OpenLiteSpeed also have support for .htaccess but it is limited to certain features.

 

If you want to learn other differences in details you can visit here.


What should I choose, CyberPanel or CyberPanel Enterprise?

 

Now there comes a great question. How can I determine as to what server I need?

 

You are good with OpenLiteSpeed, if:

 

  1. You just have a normal WordPress blog.
  2. WordPress blog with WooCommerce but you don’t use ESI.
  3. Forum scripts like Vanilla or other forums scripts that do not rely heavily on the .htaccess file.
  4. Drupal-based sites.
  5. Joomla Based sites.

 

Or any other sites that don’t heavily rely on .htaccess files and don’t require ESI feature.

 

You will definitely need LiteSpeed Enterprise, if:

 

  1. If you are using ESI hole punching on WordPress, mostly needed with WooCommerce stores and shopping sites.
  2. Magento and Prestashop stores as their cache plugins require ESI.
  3. And apart from that, almost everything is compatible with LiteSpeed Enterprise.

Features that come with CyberPanel

 

Let’s list out some major features that come with CyberPanel.

 

  1. OpenLiteSpeed or LiteSpeed Enterprise Web server (Apache can be used as backend through our platform)
  2. Mail Server (Postfix/Dovecot/Rainloop)
  3. Email Marketing Tool Kit.
  4. Security via FirewallD and SSH Hardeing options.
  5. FTP Server
  6. DNS Server
  7. Docker Manager
  8. Containrization. (Also available via our platform)
  9. Email Limits

 

All these features are available via just one install command, we will see how we can install and use CyberPanel as a cpanel alternative in this tutorial.


Step 1: Get your self a VPS

 

The first step is to get yourself unmanaged or managed vps with CyberPanel. Our platform is specifically designed to interact with CyberPanel. So CyberPanel is automatically installed and is ready to use for you.

 

 

Once your VPS is ready login to your platform account.

 

  1. From left sidebar click Services.
  2. Then click Manage on your recently ordered service.

 

 

Now click Manage CyberPanel and it will take you to the page, where you can remotely manage CyberPanel through our platform giving you many extra features. We are further going to discuss additional points in our next steps.


Step 2: Update DNS for your domain

 

Before moving on to creating your website, we will first make sure that DNS records are properly set. Since our domain is registered at NameCheap we will demonstrate through it. However for other domain registrars it is pretty much similar. Login to your NameCheap account. In your NameCheap dashboard you will see list of your registered domains such as:

 

 

Click Manage for the domain you are going to use, in this example we are using cyberhosting.org.

 

 

After clicking Manage, click Advanced DNS, and create your first nameserver.

 

Here 192.168.100.1 will be IP of your server make sure to replace it with the IP of your server and finally click done. This will create the following nameserver

 

ns1.yourdomain.com -> 192.168.100.1

 

Similarly, create a second nameserver such as ns2.yourdomain.com

 

 

  1. Click Domain from the top menu again, it will take you to the main dashboard for the domain.
  2. From drop down select Custom DNS and enter nameservers you just created above.
  3. Finally, click the Tick Mark.

 

Once all of these steps are done, you are ready to create your first website through our platform. However, if you don’t want to go into the hassle of registering private nameserver you can skip everything above and set up your dns on CloudFlare using this guide. With CloudFlare all you have to do is set their provided nameservers and then add A records in their dashboard, you can also turn on CloudFlare proxy for speed improvements, but it is the topic of another day.


Step 3: Create Website in CyberPanel

 

After clicking Manage CyberPanel from the last step you will land on a page that will look like:

 

 

Click Create Website, so that it can take you to create a website page.

 

 

Fill the Create Website form and click Create Website. Please note that you can also check SSL and Apache as Back End option. Learn more about Apache as Back End option for SSL option to work make sure your DNS records for the domain is already updated as discussed in the step above. Once the website is created, we can move on to further important settings like creating an FTP account or database for your application.


Step 4: Creating an FTP Account

 

 

Once the website is created, click on your service ID. You will be brought back to the page where you can manage your sites created in the CyberPanel.

 

 

Click the launch icon.

 

 

From the left sidebar, click Create FTP Account under FTP. Fill in all the details and click Create FTP button. You can leave the path empty and default path will be used which is usually document root of the website (i.e. /home/domain.com). But if you set some path such as helloworld the final path will be relative to document root such as /home/domain.com/public_html/helloworld.

 

FTP Account is necessary to upload your website/application files. But if you are going to use our Auto Installer creating FTP account is not really necessary.


Step 5: Creating a Database Account

 

 

If you followed our previous step you are already on the page from where you can click Create Database from the left sidebar, if not, you can click Server ID from top, launch the website and then you will land on the page where you are able to create a database for websites.

 

Fill in all the details and click Create Database. However as discussed in the last step, if you have used our Auto Installer, it will also take care of database creation, so you need not create a database as well.


Step 6: Backup Strategy

 

Until now you can guess how easy it is to use CyberPanel which makes it a great cPanel alternative. However, without a proper backup strategy, you can’t have a good night sleep. Our platform provides you various automatic ways to configure daily/weekly backups. You can configure daily/weekly backups to following storage services:

 

  1. AWS S3 (You can sign with AWS to get 5GB space for free)
  2. DigitalOcean Spaces
  3. Or self hosted S3 Compatible MINIO Storage.

 

 

Configure Backups to AWS S3

 

 

Login to our dashboard and go to services and select the service on which you want to configure backups. And click Manage CyberPanel.

 

On this page scroll down and click S3 Backups. Which will land you on this page:

 

 

First, you need to connect your AWS account. You can create a separate user through Amazon IAM Console. More detailed instructions are available here. Make sure you give that user programmatic access and access to S3 related operations in your account. Finally, click Connect Account.

 

From the left sidebar, click Create Backup Plan. So that you can finally send backups to AWS S3. Before creating a plan make sure you have created a new bucket in AWS S3 as you need to select a bucket to send backups to. On the create plan page you will be asked for:

 

  1. Plan Name – Plan names are used to identify backup plans when they are sent to AWS S3 Buckets
  2. AWS S3 Bucket: AWS S3 Bucket that will be used to store backups
  3. Frequency: How often the backup will be generated and sent (Daily/Weekly)
  4. Finally select domains that you want to include in the backup plan.

 

Once all of these are configured, just click Create Plan. You can also force run a backup at any point or view backups log right through our platform.

 

Configure backups to DigitalOcean Spaces

 

 

Login to our dashboard and go to services and select the service on which you want to configure backups. And click Manage CyberPanel.

 

On this page scroll down and click DO Backups. Which will land you on this page:

 

 

First, you need to connect your DigitalOcean account. Credentials can be configured in your DigitalOcean Apps & API section. Finally, click Connect Account. Once connected, the page will refresh and gives you confirmation that your account is successfully connected.

 

From the left sidebar, click Create Backup Plan. So that you can finally send backups to DigitalOcean Spaces. Before creating a plan make sure you have created a new Space as you need to select space to send backups to. On the create plan page you will be asked for:

 

  1. Plan Name – Plan names are used to identify backup plans when they are sent to DigitalOcean spaces
  2. Region: Select the region where you have created a space to store backups
  3. DO Bucket: DO Bucket/Space that will be used to store backups
  4. Frequency: How often the backup will be generated and sent (Daily/Weekly)
  5. Finally, select domains that you want to include in the backup plan.

 

Once all of these are configured, just click Create Plan. You can also force run a backup at any point or view backups log right through our platform.


Conclusion

 

We’ve discussed almost every angle that is needed to run a basic or advanced site. From creating a website to creating a database and finally choosing the backup strategy we did it all. As you can see it is super easy and convenient which make CyberPanel a great cPanel alternative. Depending upon your needs you can either choose a free or paid version as well.

OpenLiteSpeed vs NGINX

OpenLiteSpeed is getting lots of attention lately. OpenLiteSpeed is an open source version of LiteSpeed Enterprise Web Server that shares the same code base thus you eventually get the same Enterprise Grade performance. Today we will see the performance of openlitespeed vs nginx.  We will look into various scenarios such as

 

  1. Static file performance of openlitespeed vs nginx.
  2. Simple PHP file performance.
  3. WordPress site performance with and without LSCache and FastCGI Cache for NGINX.

 

We will run our tests on DigitalOcean $5 Droplet with following specs:

 

  1. 1GB Ram.
  2. 25GB SSD Disk Space.

 

For OpenLiteSpeed environment, we will install CyberPanel and for NGINX environment we will use clean VestaCP installation. We will be using h2load for benchmarking on a DigitalOcean $10 plan. (All these virtual machines reside in Frankfurt location)


Install h2load (nghttp2)

 

As mentioned above, we are going to use h2load for performing benchmarks. On our Centos 7.6 DigitalOcean server ($10 plan) we ran following commands to install h2load

 

yum install epel-release -y

yum install nghttp2

 

Then make sure it is installed

 

[[email protected] nghttp2]# h2load –version
h2load nghttp2/1.31.1

 

This server is only dedicated to run the benchmarks.


Make sure to Enable HTTP2 on NGINX Server

 

By default on VestaCP, you get HTTP 1.1 with NGINX. You can open the vhost configuration file to turn on HTTP2.

 

nano /home/admin/conf/web/yourdomain.com.nginx.ssl.conf

 

Replace yourdomain.com with the domain you have on VestaCP. Once in the file convert

 

server {
listen 192.168.100.1:443;

 

Into

 

server {
listen 192.168.100.1:443 ssl http2;

 

Save the file and restart nginx using systemctl restart nginx. On CyberPanel you will get HTTP2 by default.


Let’s test a small static file of 725 Bytes

 

In this test, we will be using the following command

 

h2load -t1 -H ‘Accept-Encoding: gzip’ -c1000 -n100000

 

 

OpenLiteSpeed completed the requests in almost half the time.

 

Result for OpenLiteSpeed

 

[[email protected] nghttp2]# h2load -t1 -H ‘Accept-Encoding: gzip’ -c1000 -n100000 $domainols
starting benchmark…
spawning thread #0: 1000 total client(s). 100000 total requests
TLS Protocol: TLSv1.2
Cipher: ECDHE-RSA-AES128-GCM-SHA256
Server Temp Key: ECDH P-256 256 bits
Application protocol: h2
progress: 10% done
progress: 20% done
progress: 30% done
progress: 40% done
progress: 50% done
progress: 60% done
progress: 70% done
progress: 80% done
progress: 90% done
progress: 100% done

finished in 7.77s, 12864.34 req/s, 4.71MB/s
requests: 100000 total, 100000 started, 100000 done, 100000 succeeded, 0 failed, 0 errored, 0 timeout
status codes: 100000 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 36.64MB (38416114) total, 1.21MB (1267114) headers (space savings 94.34%), 32.81MB (34400000) data
min max mean sd +/- sd
time for request: 4.47ms 468.95ms 66.97ms 16.56ms 94.64%
time for connect: 186.83ms 1.97s 864.64ms 371.78ms 88.00%
time to 1st byte: 615.39ms 2.03s 970.81ms 343.46ms 90.80%
req/s : 12.90 13.47 13.23 0.14 70.60%

 

 

Result for NGINX

 

[[email protected] nghttp2]# h2load -t1 -H ‘Accept-Encoding: gzip’ -c1000 -n100000 $domainnginx
starting benchmark…
spawning thread #0: 1000 total client(s). 100000 total requests
TLS Protocol: TLSv1.2
Cipher: ECDHE-RSA-AES256-GCM-SHA384
Server Temp Key: ECDH P-256 256 bits
Application protocol: h2
progress: 10% done
progress: 20% done
progress: 30% done
progress: 40% done
progress: 50% done
progress: 60% done
progress: 70% done
progress: 80% done
progress: 90% done
progress: 100% done

finished in 17.68s, 5657.34 req/s, 2.57MB/s
requests: 100000 total, 100000 started, 100000 done, 100000 succeeded, 0 failed, 0 errored, 0 timeout
status codes: 100000 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 45.35MB (47549000) total, 10.78MB (11300000) headers (space savings 35.80%), 32.81MB (34400000) data
min max mean sd +/- sd
time for request: 69.67ms 1.46s 104.37ms 74.98ms 96.91%
time for connect: 6.19s 7.76s 7.13s 521.05ms 61.80%
time to 1st byte: 7.66s 7.95s 7.75s 71.72ms 62.60%
req/s : 5.66 5.71 5.69 0.01 66.90%

 

Make sure that when you run the test against NGINX application protocol is h2.


Static file of size 2MB

 

In this test, we will be using the following command

 

h2load -t1 -H ‘Accept-Encoding: gzip’ -c100 -n1000

 

 

OpenLiteSpeed completed the requests in 8.4 seconds, while for the same number of requests NGINX took 74.81 seconds.

 

Result for OpenLiteSpeed

 

[[email protected] nghttp2]# h2load -t1 -H ‘Accept-Encoding: gzip’ -c100 -n1000 $domainols
starting benchmark…
spawning thread #0: 100 total client(s). 1000 total requests
TLS Protocol: TLSv1.2
Cipher: ECDHE-RSA-AES128-GCM-SHA256
Server Temp Key: ECDH P-256 256 bits
Application protocol: h2
progress: 10% done
progress: 20% done
progress: 30% done
progress: 40% done
progress: 50% done
progress: 60% done
progress: 70% done
progress: 80% done
progress: 90% done
progress: 100% done

finished in 8.40s, 119.05 req/s, 231.84MB/s
requests: 1000 total, 1000 started, 1000 done, 1000 succeeded, 0 failed, 0 errored, 0 timeout
status codes: 1000 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 1.90GB (2041926867) total, 37.08KB (37967) headers (space savings 83.56%), 1.90GB (2036628000) data
min max mean sd +/- sd
time for request: 7.53ms 1.94s 791.62ms 185.17ms 75.20%
time for connect: 101.46ms 112.75ms 107.14ms 2.21ms 71.00%
time to 1st byte: 115.26ms 136.43ms 125.44ms 5.40ms 61.00%
req/s : 1.19 1.40 1.25 0.04 68.00%

 

 

Result for NGINX

 

[[email protected] nghttp2]# h2load -t1 -H ‘Accept-Encoding: gzip’ -c100 -n1000 $domainnginx
starting benchmark…
spawning thread #0: 100 total client(s). 1000 total requests
TLS Protocol: TLSv1.2
Cipher: ECDHE-RSA-AES256-GCM-SHA384
Server Temp Key: ECDH P-256 256 bits
Application protocol: h2
progress: 10% done
progress: 20% done
progress: 30% done
progress: 40% done
progress: 50% done
progress: 60% done
progress: 70% done
progress: 80% done
progress: 90% done
progress: 100% done

finished in 74.81s, 13.37 req/s, 25.99MB/s
requests: 1000 total, 1000 started, 1000 done, 1000 succeeded, 0 failed, 0 errored, 0 timeout
status codes: 1000 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 1.90GB (2039006900) total, 112.30KB (115000) headers (space savings 35.75%), 1.90GB (2036628000) data
min max mean sd +/- sd
time for request: 66.81ms 44.02s 7.04s 1.82s 92.30%
time for connect: 545.07ms 920.01ms 646.84ms 92.66ms 86.00%
time to 1st byte: 635.69ms 8.21s 4.34s 2.17s 59.00%
req/s : 0.13 0.15 0.14 0.00 61.00%

 

In both large and small files OpenLiteSpeed clearly stands a winner.


Testing a simple PHP Hello World Application

 

We will now create a simple php file with the following content:

 

<?php

echo “hello world”

?>

 

Additional Configuration for OpenLiteSpeed

 

PHP_LSAPI_CHILDREN=10

LSAPI_AVOID_FORK=1

 

Additional Configuration for NGINX

 

pm.start_servers = 10

 

Command Used

 

h2load -t1 -H ‘Accept-Encoding: gzip’ -c1000 -n100000

 

 

OpenLiteSpeed completed the requests in 23.76 seconds, while for the same number of requests NGINX took 115.02 seconds. OpenLiteSpeed is a winner with PHP application due to its own implementation of PHP processes called LSPHP (PHP + LSAPI) it performs much better then PHP-FPM which is being used with NGINX.


LiteSpeed Cache vs FastCGI Caching with NGINX

 

We will now discuss caching in OpenLiteSpeed and NGINX.

 

 

With OpenLiteSpeed web server you get a built-in cache module and with NGINX you get a FastCGI Caching Module.

 

Why OpenLiteSpeed Cache Module is better?

 

  1. Tag-based caching, pages can be cached for an unlimited amount of time until the cache copy gets invalid.
  2. Built right into the Web server.
  3. Multiple Cache modules available for popular CMS.
  4. Use disk to save cache copies.

 

What is wrong with NGINX Based FastCGI Caching

 

  1. Not tag based caching, or you can say time-based caching.
  2. This type of caching is not intelligent and does not know when to invalidate the cache copy.
  3. You can use as MicroCaching but it is explained here as to why MicroCaching is not recommended.

Benchmarking LiteSpeed vs NGINX for WordPress

 

We will now benchmark litespeed vs nginx for wordpress by installing WordPress on both.

 

  1. OpenLiteSpeed will use LiteSpeed Official WordPress Caching Plugin.
  2. On NGINX setup we will use Cache Enabler Caching plugin.

 

Command used

 

h2load -t1 -H ‘Accept-Encoding: gzip’ -c100 -n1000

 

 

The first question after seeing the graph above will be why OpenLiteSpeed took only 1.4 seconds and NGINX (even using the cache plugin) took 91.6 seconds to complete the same number of requests. Let’s recall the image we shared above.

 

 

Here you can see that in case of OpenLiteSpeed when there is a cache hit, request does not go to PHP Engine which is a very costly operation that causes all the bottleneck. Because OpenLiteSpeed cache module sits inside the web server and all logic is handled there, which means no need to invoke PHP Engine.

 

However in case of NGINX, it is not true, Cache Enabler plugin resides on the PHP side. So even if there is a cache hit, PHP needs to be forked and used which causes all the bottleneck.  Let see the detailed results now

 

OpenLiteSpeed

 

[[email protected] nghttp2]# h2load -t1 -H ‘Accept-Encoding: gzip’ -c100 -n10000 $domainols
starting benchmark…
spawning thread #0: 100 total client(s). 10000 total requests
TLS Protocol: TLSv1.2
Cipher: ECDHE-RSA-AES128-GCM-SHA256
Server Temp Key: ECDH P-256 256 bits
Application protocol: h2
progress: 10% done
progress: 20% done
progress: 30% done
progress: 40% done
progress: 50% done
progress: 60% done
progress: 70% done
progress: 80% done
progress: 90% done
progress: 100% done

finished in 1.44s, 6925.11 req/s, 25.10MB/s
requests: 10000 total, 10000 started, 10000 done, 10000 succeeded, 0 failed, 0 errored, 0 timeout
status codes: 10000 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 36.25MB (38006300) total, 118.55KB (121400) headers (space savings 95.55%), 35.87MB (37610000) data
min max mean sd +/- sd
time for request: 9.31ms 20.81ms 13.39ms 1.13ms 89.23%
time for connect: 89.91ms 100.89ms 95.89ms 2.78ms 64.00%
time to 1st byte: 101.79ms 113.77ms 107.89ms 3.45ms 61.00%
req/s : 69.35 70.00 69.66 0.19 62.00%

 

NGINX

 

[[email protected] nghttp2]# h2load -t1 -H ‘Accept-Encoding: gzip’ -c100 -n10000 $domainnginx
starting benchmark…
spawning thread #0: 100 total client(s). 10000 total requests
TLS Protocol: TLSv1.2
Cipher: ECDHE-RSA-AES256-GCM-SHA384
Server Temp Key: ECDH P-256 256 bits
Application protocol: h2
progress: 10% done
progress: 20% done
progress: 30% done
progress: 40% done
progress: 50% done
progress: 60% done
progress: 70% done
progress: 80% done
progress: 90% done
progress: 100% done

finished in 91.69s, 109.06 req/s, 417.50KB/s
requests: 10000 total, 10000 started, 10000 done, 10000 succeeded, 0 failed, 0 errored, 0 timeout
status codes: 10000 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 37.38MB (39198270) total, 1.44MB (1513370) headers (space savings 27.93%), 35.76MB (37500000) data
min max mean sd +/- sd
time for request: 355.76ms 1.23s 907.05ms 78.63ms 76.91%
time for connect: 357.00ms 678.18ms 506.17ms 153.42ms 54.00%
time to 1st byte: 712.81ms 1.60s 1.15s 264.29ms 57.00%
req/s : 1.09 1.10 1.10 0.00 57.00%


OpenLiteSpeed and .htaccess

 

OpenLiteSpeed also have a support for .htaccess file (very popular feature provided by Apache Web Server). But some people confuse with with slow performance, yes incase of Apache your performance will get affected if you have enabled the use of .htaccess file. However in case of OpenLiteSpeed it will only look for .htaccess file in the directory for the first time, which means you get benefit of .htaccess file along with high performance.


Conclusion

 

We ran multiple type of tests

 

  1. Small static file.
  2. Large static file.
  3. Simple Hello World php application.
  4. WordPress Site

 

In all the cases OpenLiteSpeed was clear winner against NGINX. So what are you waiting for, you can start right now with our managed vps service and let us handle the speed for you. You get 3 days free trial (no credit card required) with free migration.

InnoDB: Cannot allocate memory for the buffer pool [Solved]

Recently we received a ticket where the client pointed out that his MySQL server was not starting. Upon investigation, we found out that the client used our MySQL Optimization tool to optimize and enhance MySQL performance. Our MySQL optimization tool set value of innodb-buffer-pool-size size depending upon the available ram on the server. The current formula set its value to 35% of the server ram. Which is fine for most cases, but in this case it was not good, because there were some other processes in the client server taking more ram, so there was not enough ram available to allocate for innodb-buffer-pool-size thus MySQL reports  InnoDB: Cannot allocate memory for the buffer pool as error in MySQL log file.

 

Depending upon the MySQL version you might also receive innodb fatal error cannot allocate memory for the buffer pool as an error, which is the same error with a different description.

 

If doing this is too much for you, you can sign up with us and let our experts do this for you. We offer 3 days free trial no credit card required start free with our managed vps now. We also help our customers with MySQL optimizations.


What is InnoDB Buffer Pool (innodb_buffer_pool_size) and why it is important?

 

InnoDB Buffer is the space in memory used by MySQL to hold many of its InnoDB data structures. Such as caches, buffers, indexes, and even row data. And then innodb_buffer_pool_size is the MySQL directive that controls its value. This is one of the most significant directive in MySQL perspective and should be set with care if you want to improve your MySQL performance.

 

In this tutorial we will see how we can calculate and set optimal value for innodb_buffer_pool_size depending on the available memory on your system and then we will discuss on how to solve InnoDB: Cannot allocate memory for the buffer pool error in case you run into it at a later point in time.


70% – 80% of the Available Ram

 

Normally if your server is only dedicated for MySQL it is recommended to set innodb_buffer_pool_size value to 70-80% of the available ram. So for example, if your server has 8GB of ram, you can calculate the value of innodb_buffer_pool_size using this formula

 

8 * 0.80 = 6.4GB

 

But in case if your server has a very large amount of ram such as 256GB, then you can further enhance it to 90% as well. Because if your server is only being used for MySQL, the rest of the ram will go in waste, so you can increase or decrease this value depending upon the available ram or your needs.

 

If doing this is too much for you, you can sign up with us and let our experts do this for you. We offer 3 days free trial no credit card required start free with our managed vps now. We also help our customers with MySQL optimizations.


Optimal value with CyberPanel

 

When you are using CyberPanel then 70-80% ram cannot be allocated for innodb_buffer_pool_size size, because there are many other things running and there must be some room for them to breath. Otherwise, if you set a large value for innodb_buffer_pool_size you will start receiving InnoDB: Cannot allocate memory for the buffer pool or innodb fatal error cannot allocate memory for the buffer pool as an error. Which means there is not enough ram available and MySQL cannot start now. Which is why our optimization tool set it to 35% of the available ram.

 

But sometimes 35% is not good as well. For example, you have lots of websites and they are continuously forking PHP processes and you are also using FTP and DNS server. Then you either need to further go down with the value of innodb_buffer_pool_size.


Fixing the InnoDB: Cannot allocate memory for the buffer pool error

 

Now let see how we can fix this error, let say you have used or MySQL Optimization tool, and now MySQL is not starting. First, make sure that this is the reason your MySQL is not starting. You can open the MySQL log file located at /var/lib/mysql/mysqld.log. This location is set by our optimization tool, if you are not using our tool, you can find MySQL log file depending upon your configuration, and you must see the following lines somewhere in the log file

 

2019-06-11 10:52:09 140525444196608 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2019-06-11 10:52:09 140525444196608 [Note] InnoDB: The InnoDB memory heap is disabled
2019-06-11 10:52:09 140525444196608 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-06-11 10:52:09 140525444196608 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2019-06-11 10:52:09 140525444196608 [Note] InnoDB: Compressed tables use zlib 1.2.7
2019-06-11 10:52:09 140525444196608 [Note] InnoDB: Using Linux native AIO
2019-06-11 10:52:09 140525444196608 [Note] InnoDB: Using SSE crc32 instructions
2019-06-11 10:52:09 140525444196608 [Note] InnoDB: Initializing buffer pool, size = 358.0M
InnoDB: mmap(393183232 bytes) failed; errno 12
2019-06-11 10:52:09 140525444196608 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2019-06-11 10:52:09 140525444196608 [ERROR] Plugin ‘InnoDB’ init function returned error.
2019-06-11 10:52:09 140525444196608 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.

 

Pay close attention to the bold lines, we are now sure that MySQL failed at InnoDB: Initializing buffer pool. Now open /etc/my.cnf and find innodb-buffer-pool-size = xxxM. Now set the value of this directive to something lower such as 50MB just for test and restart MySQL using systemctl restart mysql. However, you can play with various values and make sure you get the optimal value for your configuration.

 

If doing this is too much for you, you can sign up with us and let our experts do this for you. We offer 3 days free trial no credit card required start free with our managed vps now. We also help our customers with MySQL optimizations.

 

1 – Introduction to Containerization (Website Limits)

Containerization feature via our Cloud Platform (CyberPanel v1.8.4 and above required, currently only CentOS is supported) offers to limit website resources. With containerization you can limit various system resources for a website, cgroups are used on the back end to enforce these limits. You can limit:

 

  1. CPU Usage.
  2. Memory Usage.
  3. Network Usage.
  4. Disk Usage (IO and IOPS)

 

These limits are applied to all processes forked under a website user (Such as lsphp processes). You can use ls -la /home command to find out user of each website. LiteSpeed Webserver forks php processes for sites using these Linux user accounts. If there are no limits applied a single tenant can use all available resources on your system.

 

Next: Apply Limits to Websites