A
A
Alexander2012-03-16 14:51:00
PHP
Alexander, 2012-03-16 14:51:00

Website performance issue

Given : 4-core dedicated server, 2GB RAM, 32-bit Ubuntu 8.04 with ~30 virtual hosts with a light load on average. Apache + MySQL + PHP 5.2.4 is spinning.

Problem :
One of the virtual hosts is running slowly - with a response of ~ 7 seconds. It has the highest attendance. There are two more hosts with exactly the same CMS (Joomla 1.0), but for other languages, where traffic is lower and the response is much faster. Also, this is definitely not a problem with loading page elements in the browser.

Question : Why are the brakes on only one virtual host, while everything is fine on the others?

The size of the used RAM is small ~ 600Mb.
After a reboot, the site more or less comes to life.
Here is the uptime for the last hour after it: 0.10, 0.22, 0.34
On average, about ~1000 uniques per day on the problem virtual host, on the other two ~100-200.

netstat -an -t | awk '$4 ~ /\:80$|\:443$/ {s=s+1} END {print s}'
gives out from 60 to 170

I immediately say - I do not administer the server and I understand that for good it would be necessary to put nginx on the front-end and cache.
But before you get confused with this (after all, a production server), you want to be sure that the problem is not in the performance of PHP or MySQL. Considering that I have no experience in performance auditing, I would be very grateful for tips.

UPDATE:

The problem has been fixed - I found a call to the left script, which has long lost its relevance. He blocked the execution of PHP.
In fact, it also turned out that the CPU load is slightly higher than the norm, long queries do not hang in the database. The number of requests per unit of time does not look intimidating. But we will still install nginx and eAccelerator.

Many thanks to everyone for the replies!

Answer the question

In order to leave comments, you need to log in

7 answer(s)
S
skvot, 2012-03-16
@skvot

For starters, the most banal - check if caching is enabled in the system and analyze long queries

A
alexmuz, 2012-03-16
@alexmuz

The problem is in the used CMS Joomla 1.0.
And you answered your own question.

One of the virtual hosts is running slowly - with a response of ~ 7 seconds. It just has the highest attendance .

Immediately after the reboot, you have a small number of simultaneous requests to this virtual host of yours, so the site comes to life, when more visitors come, everything returns.
Install nginx and google how to tune Joomla, you can probably turn on some kind of caching. Well, at least look at what queries are being executed, are there all the necessary indexes, most likely the problem is in MySQL queries.

R
rakot, 2012-03-16
@rakot

We open top and see who eats a lot of what, we open the most gluttonous. If no one, then most likely the matter is in some kind of lock, perhaps even in the file one (the system is waiting for a lock to write to the cache file).

A
AHTOH, 2012-03-16
@AHTHOH

2 GB of RAM is not too much for such hosting. At peak load, the server does not run out of memory by any chance? Not through a swap starts to work? If yes, then it will be cheaper to deliver gigs of memory up to 16.

S
Stdit, 2012-03-16
@Stdit

Enable long query logging . Sometimes such problems are solved by setting the correct index and/or mysql cache.

E
egorinsk, 2012-03-16
@egorinsk

You need to watch what happens during the request, ideally profile it, and then draw conclusions.

A
Alexey Akulovich, 2012-03-18
@AterCattus

apachetop and xdebug logs to help

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question