Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

Serving PHP Sites is getting slow till i restart Apache

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
11 posts
  • 1
  • 2
  • Next
joschi
Posts: 10
Joined: Sat Sep 27, 2014 3:41 am

Serving PHP Sites is getting slow till i restart Apache
  • Quote

Post by joschi » Thu Nov 30, 2017 12:29 pm

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
Top

mehargags
Support team
Posts: 1096
Joined: Sat Sep 06, 2014 9:58 pm
Contact:
Contact mehargags
Website Skype

Os: Debian 8x
Web: apache + nginx
Re: Serving PHP Sites is getting slow till i restart Apache
  • Quote

Post by mehargags » Fri Dec 01, 2017 8:33 pm

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
Top

joschi
Posts: 10
Joined: Sat Sep 27, 2014 3:41 am

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

Post by joschi » Sun Dec 03, 2017 3:15 pm

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
Top

mehargags
Support team
Posts: 1096
Joined: Sat Sep 06, 2014 9:58 pm
Contact:
Contact mehargags
Website Skype

Os: Debian 8x
Web: apache + nginx
Re: Serving PHP Sites is getting slow till i restart Apache
  • Quote

Post by mehargags » Sun Dec 03, 2017 8:33 pm

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.
Top

joschi
Posts: 10
Joined: Sat Sep 27, 2014 3:41 am

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

Post by joschi » Sun Dec 03, 2017 9:43 pm

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
Top

mehargags
Support team
Posts: 1096
Joined: Sat Sep 06, 2014 9:58 pm
Contact:
Contact mehargags
Website Skype

Os: Debian 8x
Web: apache + nginx
Re: Serving PHP Sites is getting slow till i restart Apache
  • Quote

Post by mehargags » Mon Dec 04, 2017 8:20 am

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
Top

joschi
Posts: 10
Joined: Sat Sep 27, 2014 3:41 am

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

Post by joschi » Mon Dec 04, 2017 2:11 pm

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
Top

mehargags
Support team
Posts: 1096
Joined: Sat Sep 06, 2014 9:58 pm
Contact:
Contact mehargags
Website Skype

Os: Debian 8x
Web: apache + nginx
Re: Serving PHP Sites is getting slow till i restart Apache
  • Quote

Post by mehargags » Mon Dec 04, 2017 3:41 pm

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 :)
Top

joschi
Posts: 10
Joined: Sat Sep 27, 2014 3:41 am

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

Post by joschi » Wed Dec 06, 2017 2:07 am

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
Top

aman2254
Posts: 1
Joined: Wed Dec 06, 2017 5:21 pm

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

Post by aman2254 » Wed Dec 06, 2017 5:25 pm

may be u getting ddos attack on ur server reboot and protect ur ssh try this
Top


Post Reply
  • Print view

11 posts
  • 1
  • 2
  • Next

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password