Page 1 of 2

Serving PHP Sites is getting slow till i restart Apache

Posted: Thu Nov 30, 2017 12:29 pm
by joschi
Hi, @ all
@VestaCpTeam, Thank you for this great piece of software. I am using VestaCP now for several years without any big issues.

Problem: I am running Vesta CP on 2 different servers. My site loads with 0.8 seconds which is great! Problem is, after a while the sites needs 2.5 seconds to load and stays at this level.
When i restart (only) apache2 everything is back to fast again, but just for a few hours, then its getting slow again.

- Both servers run Apache + Nginx
- its the same on both of my servers.
- Both servers have a quad core and 8gb of ram which seems not to be full

Where can i start to investigate this issue?
Anay help is highly appreciated!

Kind regards
Patrick

Re: Serving PHP Sites is getting slow till i restart Apache

Posted: Fri Dec 01, 2017 8:33 pm
by mehargags
This can be a time taking procedure, but there isn't a shortcut I'm afraid.

♦Monitor your CPU / RAM usage with HTOP, try to see the threads that are taking up CPU Cycles or RAM.
♦Monitor your network throughput for outgoing traffic using iftop, iptraf or netstat

How many sites you have on the server ? Try suspending them one by one and observing performance after suspending each on to of them. It is entirely possible that one or your site's is compromised and is being abused eating up network and CPU resources.

Good luck

Re: Serving PHP Sites is getting slow till i restart Apache

Posted: Sun Dec 03, 2017 3:15 pm
by joschi
Hi mehargags, thanks for pointing this out,
Luckily i already monitor those stats in detail.

I have round about 40 WordPress Sites on each Server, most of them very low traffic, some get a few thousand visitors a day. The Servers have a Gbit connection tho. There are not used for heavy downloads but only for serving normal websites.

Here are the stats from the last month, where i did not do any restarts. For me everything seems pretty normal, also when you zoom in to just a day. Do you think otherwhise?

RAM:
Image

Network:
Image

CPU
Image

Any other ideas? :)
Kind regards
Patrick

Re: Serving PHP Sites is getting slow till i restart Apache

Posted: Sun Dec 03, 2017 8:33 pm
by mehargags
Mere looking at the graph is not how you find the problem...You did not follow my suggestion, please read carefully the action I suggested.

Re: Serving PHP Sites is getting slow till i restart Apache

Posted: Sun Dec 03, 2017 9:43 pm
by joschi
Hi mehargags, thank you for your time.

I checked the CPU Load as well as network stats with slurm, und just wanted to say that there was nothing special at any time. I will check again, i have to wait a while tho till the circumstances apear again :) Then i will suspend one site after another till only one is left, and then see if something changes and report back here.
Thanks
Patrick

Re: Serving PHP Sites is getting slow till i restart Apache

Posted: Mon Dec 04, 2017 8:20 am
by mehargags
since there are many sites, you can do it in badges of 5 to speed up the process.

However,
Don't try to make too much money out of one server, you risk all eggs in one basket.
The proper, easeier way to do this would be to get a second server ( may be a bit smaller/cheaper) and put the very low sites onto it... in badges of 5. This way you have your sites running all the time so the customers don't complain, and also pin point which one's slowing down the resources.

By the way, what is your send mail queue count?

Code: Select all

exim -bpc

Re: Serving PHP Sites is getting slow till i restart Apache

Posted: Mon Dec 04, 2017 2:11 pm
by joschi
Most sites are private / for testing purpose, thats why they get very little traffic if at all...
So you think it could help if i dedicate more ram to the servers? As i mentioned, it does not seem like the servers are bussy in any way.
This it what it looks most of the time... But it would be no problem for me to give them some extra ram if that could help.
https://gyazo.com/ab165d669f3023c13a26d8b00fe29c1a

All websites are WordPress based and have caching enabled. This helps a lot reducing the server load.

My first server has 7 mails in the queue the second 0. But i dont use vestacp to send mails. :)

kind regards
Patrick

Re: Serving PHP Sites is getting slow till i restart Apache

Posted: Mon Dec 04, 2017 3:41 pm
by mehargags
In that case, I guess suspending a few sites (in batches) and watching performance is best bet.

Those 7 mails in queue, where are they going ? Refer http://bradthemad.org/tech/notes/exim_cheatsheet.php

You can PM me for sensitive information, I'll take a look :)

Re: Serving PHP Sites is getting slow till i restart Apache

Posted: Wed Dec 06, 2017 2:07 am
by joschi
Ok, i will do so next weekend at night :)

Only 4 mails in there right now, basically they are system mails marked as "frozen" going to root, nothing special from my point of view.

Kind regards
Patrick

Re: Serving PHP Sites is getting slow till i restart Apache

Posted: Wed Dec 06, 2017 5:25 pm
by aman2254
may be u getting ddos attack on ur server reboot and protect ur ssh try this