Question

website down but server is fine(nginx)

It has been going on for the last week or so, this issue and I cannot seems to pin point the exact issue. I have a monitor set up which emails me when the site is down in day it can be done for up to 3 times and if I do not reboot the droplet it will take around 2-3 hours before the site is back up and running again.

Droplet information

2 GB Memory / 60 GB Disk / LON1 Ubuntu 20.04.3 LTS

I have 2 ecommerce wordpress sites running on this droplet.

Sudo ufw status

Status: active

To                         Action      From
--                         ------      ----
22                         ALLOW       Anywhere
80                         ALLOW       Anywhere
443                        ALLOW       Anywhere
21/tcp                     ALLOW       Anywhere
Nginx Full                 ALLOW       Anywhere
22 (v6)                    ALLOW       Anywhere (v6)
80 (v6)                    ALLOW       Anywhere (v6)
443 (v6)                   ALLOW       Anywhere (v6)
21/tcp (v6)                ALLOW       Anywhere (v6)
Nginx Full (v6)            ALLOW       Anywhere (v6)
df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            984M     0  984M   0% /dev
tmpfs           200M  688K  199M   1% /run
/dev/vda1        58G   16G   43G  27% /
tmpfs           997M     0  997M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           997M     0  997M   0% /sys/fs/cgroup
/dev/vda15      105M  8.9M   96M   9% /boot/efi
tmpfs           200M     0  200M   0% /run/user/0

I do not know what else to check. Please help.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Let’s start with Server Optimization.

When looking at Server/Droplet Optimization, there are a few necessary services/packages that are universal.

  • The first one would be Server-side caching. Server cache is an umbrella term covering a number of different types of caching. This includes Content Delivery Network (CDN) caching, object caching, and opcode caching. Depending on what you want to achieve you might need one or the other. Usually, though, you can have all 3 types of caching as it shouldn’t interfere with your Website/App. I won’t go into more details about what each caching does as this post will become 3 pages long. There are multiple documents providing services/packages for each of the server-type caching.

  • Next would be using PHP-FPM (if your Website is using PHP of course). PHP-FPM is an efficient method on how to minimize the memory consumption and rise the performance for the Websites with heavy traffic. It is significantly faster than traditional CGI-based methods in multi-user PHP environments.

  • Another solution would be Database Caching. A database cache supplements your primary database by removing unnecessary pressure on it, typically in the form of frequently accessed read data. The cache itself can live in a number of areas including your database, application or as a standalone layer. Usually, for this kind of caching is being used Redis.

Those were the basic optimizations on a server level, let’s start with your Website/App

If you are using a CMS like WordPress, Magento, Joomla, Opencart or anything of the same matter, there will be plugins/addons. These addons can be very powerful if used correctly. The most helpful plugins are:

  • Caching Plugins
  • Image Optimization Plugins
  • Plugins that reduce redirections/requests
  • Plugins that reduce the size of JS and CSS files.
  • More often than not, there are a lot of JS and CSS files that are not being used, removing those should work as well

If you are not using a CMS, you’ll need to try and do what these plugins are doing manually.

Usually, Websites/Apps are slow because of a couple of reasons which range from too many requests or big images to a bunch of unnecessarily big JS or CSS files. Optimizing these whether you are using a Plugin or doing it manually is enough.

I hope this was helpful.

Hi @uakpan,

When you receive the message that your website is down can you check your Nginx. Try restarting it, does it help?

Additionally, have you checked the load on the server is it more than the usual? What I believe is going on is you reaching the limit of MaxRequests on your Nginx instance and restarting it should resolve the issue. Can you please confirm this the next time your website goes down?