Raimo V
Raimo V

Reputation: 21

Slow server performance on ecommerce website

I have an ecommerece website with over a million products. Its running on debian 7, with apache2.2 , php5.4 , mysql 5.5 and laravel 4.1. It used to run smoothly, but lately it has become very slow.

I think It's because of amount of mysql queries to the server. I've used various mysql tools and found that that queries per second is very high (1000-2000). Although when im logging requests to the site and queries made It isn't nearly as much.

Also I haven't made much changes lately to the code and since it used to run ok, im not sure if the amount of queries is the problem (not sure how much it was when everything was ok).

Im looking for any ideas how to debug or find out what's wrong. The amount of users on page hasn't changed. There are about the same amount of request. I have some caching in place. But since I've got so many product pages and most of the users visit different pages so cache has little effect there. Any ideas how to make a better cache for that many product pages?

Upvotes: 0

Views: 156

Answers (2)

Rick James
Rick James

Reputation: 142528

Do you have the "Query cache" turned on? It may be helping or it may be hurting.

How much RAM is available to MySQL (including what it is using)? Let's see these for various checks:

SHOW VARIABLES;
SHOW GLOBAL STATUS;

Set long_query_time = 0.5 and

  1. turn on the slow log
  2. wait a day
  3. summarize the slowlog using mysqldumpslow -s t or pt-query-digest -- These sort by 'impact on system'.
  4. Let's see the top 3 queries for discussion. Include SHOW CREATE TABLE and EXPLAIN ....

Upvotes: 1

alexander.polomodov
alexander.polomodov

Reputation: 5534

Maybe there were changes in ratio of insert/update/delete vs selects on your site. It's usual problem when your system is configured for fast data retrieval. But at some point you increase number of insert/update/delete and all system performance sags.

Of course it can be just increasing the users on the site through good content or something else. So, you need to compare current database load and load at the previous period without such problems.

Upvotes: 0

Related Questions