News:

Support the VirtueMart project and become a member

Main Menu

Webserver overcharged with 8GHz

Started by Florentp, August 31, 2012, 14:39:31 PM

Previous topic - Next topic

Florentp

I use a VPS to host a virtuemart website. The problem is that the server is always overcharged when i have more than 30 people on the website at the same time.
Any help to improve this website will be really appreciated.


At this moment :
When i'm doing a "w" in ssh :
14:12:02 up 14:59,  1 user,  load average: 10,94, 8,68, 7,08
USER     TTY        LOGIN@   IDLE   JCPU   PCPU WHAT
root     pts/0     12:38    0.00s  0.14s  0.00s w

There is 55 people on the website



Website & server configuration :
Php : 5.3.8-pl0-gentoo
Mysql : 5.0.44
Joomla : 2.5.6 Stable
Virtuemart : 2.0.8e  (will switch to 2.0.10 soon)
Server configuration  : this is a VPS. 8GHZ 24GB of RAM


I'm using the stockable variant plugin for EVERY products.
Also using SH404, but not for virtuemart. So virtuemart generate his own SEF urls.

I'm also using JOTCACHE. A simple cache component working with vm (and the cart...).

Any help to improve this website will be really appreciated.
I think change for a real webserver, SSD disk, more cpu... But anyway, there's something wrong :/

I can provide access more informations, or access. Just ask me.
Thanks a lot.



I tried some mysql improvement with tuning-primer.sh.
still ajusting parameters, but.. Server still overcharged.

Here is my tuning-primer.sh results :
Quote
        -- MYSQL PERFORMANCE TUNING PRIMER --
             - By: Matthew Montgomery -

MySQL Version 5.0.44-log x86_64

Uptime = 0 days 1 hrs 23 min 17 sec
Avg. qps = 239
Total Questions = 1195009
Threads Connected = 8

Warning: Server has not been running for at least 48hrs.
It may not be safe to use these recommendations

To find out more information on how each of these
runtime variables effects performance visit:
http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html
Visit http://www.mysql.com/products/enterprise/advisors.html
for info about MySQL's Enterprise Monitoring and Advisory Service

SLOW QUERIES
The slow query log is NOT enabled.
Current long_query_time = 10 sec.
You have 0 out of 1195165 that take longer than 10 sec. to complete
Your long_query_time seems to be fine

BINARY UPDATE LOG
The binary update log is enabled
The expire_logs_days is not set.
The mysqld will retain the entire binary log until RESET MASTER or PURGE MASTER LOGS commands are run manually
Setting expire_logs_days will allow you to remove old binary logs automatically
See http://dev.mysql.com/doc/refman/5.0/en/purge-master-logs.html
Binlog sync is not enabled, you could loose binlog records during a server crash

WORKER THREADS
Current thread_cache_size = 5
Current threads_cached = 0
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine

MAX CONNECTIONS
Current max_connections = 100
Current threads_connected = 14
Historic max_used_connections = 45
The number of used connections is 45% of the configured maximum.
Your max_connections variable seems to be fine.

No InnoDB Support Enabled!

MEMORY USAGE
Max Memory Ever Allocated : 196 M
Configured Max Per-thread Buffers : 164 M
Configured Max Global Buffers : 122 M
Configured Max Memory Limit : 286 M
Physical Memory : 23.59 G
Max memory limit seem to be within acceptable norms

KEY BUFFER
Current MyISAM index space = 55 M
Current key_buffer_size = 16 M
Key cache miss rate is 1 : 3783
Key buffer free ratio = 54 %
Your key_buffer_size seems to be fine

QUERY CACHE
Query cache is enabled
Current query_cache_size = 80 M
Current query_cache_used = 13 M
Current query_cache_limit = 80 M
Current Query cache Memory fill ratio = 16.25 %
Current query_cache_min_res_unit = 4 K
Your query_cache_size seems to be too high.
Perhaps you can use these resources elsewhere
MySQL won't cache query results that are larger than query_cache_limit in size

SORT OPERATIONS
Current sort_buffer_size = 512 K
Current read_rnd_buffer_size = 508 K
Sort buffer seems to be fine

JOINS
Current join_buffer_size = 132.00 K
You have had 127 queries where a join could not use an index properly
You have had 42 joins without keys that check for key usage after each row
You should enable "log-queries-not-using-indexes"
Then look for non indexed joins in the slow query log.
If you are unable to optimize your queries you may want to increase your
join_buffer_size to accommodate larger joins in one pass.

Note! This script will still suggest raising the join_buffer_size when
ANY joins not using indexes are found.

OPEN FILES LIMIT
Current open_files_limit = 16110 files
The open_files_limit should typically be set to at least 2x-3x
that of table_cache if you have heavy MyISAM usage.
Your open_files_limit value seems to be fine

TABLE CACHE
Current table_cache value = 8000 tables
You have a total of 1498 tables
You have 1555 open tables.
The table_cache value seems to be fine

TEMP TABLES
Current max_heap_table_size = 100 M
Current tmp_table_size = 800 M
Of 63523 temp tables, 35% were created on disk
Effective in-memory tmp_table_size is limited to max_heap_table_size.
Perhaps you should increase your tmp_table_size and/or max_heap_table_size
to reduce the number of disk-based temporary tables
Note! BLOB and TEXT columns are not allow in memory tables.
If you are using these columns raising these values might not impact your
ratio of on disk temp tables.

TABLE SCANS
Current read_buffer_size = 252 K
Current table scan ratio = 64 : 1
read_buffer_size seems to be fine

TABLE LOCKING
Current Lock Wait ratio = 1 : 1377
You may benefit from selective use of InnoDB.
If you have a high concurrency of inserts on Dynamic row-length tables
consider setting 'concurrent_insert=2'.


Web programmer. Passionate.
PHP, SQL, Javascript, JQuery, css.
Skype : florent.indienboutique

jjk

#1
I'm no database expert, but looking at your website I suppose your primary problems are too much flash content (very slowly) loaded from s.ytimg.com and the use of external webfonts which seem to load forever.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Florentp

Are you talking about my website ?
Because i don't put any links of it on the post. Are you a spy or what :D ?

I know that my website is not optimised for the client (a lot of css and js linked).
But this is definitly another problem.

This make the website longer to get loaded, but don't overcharge the server.
It getting slow with php and mysql process using a lot of cpu.
Web programmer. Passionate.
PHP, SQL, Javascript, JQuery, css.
Skype : florent.indienboutique

jjk

Quote from: FederA on August 31, 2012, 16:04:28 PM
...Because i don't put any links of it on the post...
You did in your previous posts  ;D
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Florentp

I started to log all slow query, and i got this :

Quote# Time: 120904 12:02:07
# User@Host: teste[teste] @ localhost []
# Query_time: 11  Lock_time: 0  Rows_sent: 9  Rows_examined: 119761
SELECT SQL_CALC_FOUND_ROWS  * FROM `j17_virtuemart_products_fr_fr` as l JOIN `j17_virtuemart_products` AS p using (`virtuemart_product_id`)group by p.`virtuemart_product_id`  ORDER BY p.`created_on` DESC LIMIT 0, 9;
# Time: 120904 12:02:13
# User@Host: teste[teste] @ localhost []
# Query_time: 11  Lock_time: 0  Rows_sent: 30  Rows_examined: 119745
SELECT SQL_CALC_FOUND_ROWS  * FROM `j17_virtuemart_products_fr_fr` as l JOIN `j17_virtuemart_products` AS p using (`virtuemart_product_id`)group by p.`virtuemart_product_id`  ORDER BY p.`created_on` DESC LIMIT 0, 30;
# Time: 120904 12:26:46
# User@Host: teste[teste] @ localhost []
# Query_time: 12  Lock_time: 0  Rows_sent: 30  Rows_examined: 119825
SELECT SQL_CALC_FOUND_ROWS  * FROM `j17_virtuemart_products_fr_fr` as l JOIN `j17_virtuemart_products` AS p using (`virtuemart_product_id`)group by p.`virtuemart_product_id`  ORDER BY p.`created_on` DESC LIMIT 0, 30;
# Time: 120904 12:33:48
# User@Host: teste[teste] @ localhost []
# Query_time: 11  Lock_time: 0  Rows_sent: 30  Rows_examined: 119801
SELECT SQL_CALC_FOUND_ROWS  * FROM `j17_virtuemart_products_fr_fr` as l JOIN `j17_virtuemart_products` AS p using (`virtuemart_product_id`)group by p.`virtuemart_product_id`  ORDER BY p.`created_on` DESC LIMIT 0, 30;
# Time: 120904 12:35:56
# User@Host: teste[teste] @ localhost []
# Query_time: 13  Lock_time: 0  Rows_sent: 30  Rows_examined: 119781
SELECT SQL_CALC_FOUND_ROWS  * FROM `j17_virtuemart_products_fr_fr` as l JOIN `j17_virtuemart_products` AS p using (`virtuemart_product_id`)group by p.`virtuemart_product_id`  ORDER BY p.`created_on` DESC LIMIT 0, 30;

.. and more.
Web programmer. Passionate.
PHP, SQL, Javascript, JQuery, css.
Skype : florent.indienboutique

Florentp

Any idea ?
I'm gonna move to another server, with ssd, but it cost A LOT :(
Web programmer. Passionate.
PHP, SQL, Javascript, JQuery, css.
Skype : florent.indienboutique