I operate a Magento Community install that currently contains 30k SKUs (6k configurable with 24k variants).
We are having an ongoing issue with pervasive CPU overloads that result in MYSQL connection interruptions and httpd lockups.
Typically, the issues begin when Catalog_URL Rewrites are Reindexed, or when I mass update Amazon listings with M2ePro.
Just to get through my reindexes I:
Clear Cache and Temporal files:
rm -rf downloader/pearlib/cache/*
rm -rf downloader/pearlib/download/*
rm -rf var/cache/*
rm -rf var/session/*
rm -rf var/report/*
rm -rf var/tmp/*
Truncate Logs:
TRUNCATE log_customer;
TRUNCATE log_quote;
TRUNCATE log_summary;
TRUNCATE log_summary_type;
TRUNCATE log_url;
TRUNCATE log_url_info;
TRUNCATE log_visitor;
TRUNCATE log_visitor_info;
TRUNCATE log_visitor_online;
TRUNCATE report_event;
TRUNCATE catalogsearch_fulltext;
TRUNCATE catalogsearch_query;
TRUNCATE catalog_compare_item;
Clear the Image Cache:
rm -rf media/catalog/product/cache/*
rm -rf media/tmp/*
Set index mode to manual:
php indexer.php --mode-manual catalog_product_attribute
php indexer.php --mode-manual catalog_product_price
php indexer.php --mode-manual catalog_url
php indexer.php --mode-manual catalog_product_flat
php indexer.php --mode-manual catalog_category_flat
php indexer.php --mode-manual catalog_category_product
php indexer.php --mode-manual catalogsearch_fulltext
php indexer.php --mode-manual cataloginventory_stock
php indexer.php --mode-manual tag_summary
*Restart Cloud DB, MYSQL, and HTTPD
Reindex all indexes:*
php indexer.php -r --reindexall
Set index mode to realtime:
php indexer.php --mode-realtime catalog_product_attribute
php indexer.php --mode-realtime catalog_product_price
php indexer.php --mode-realtime catalog_url
php indexer.php --mode-realtime catalog_product_flat
php indexer.php --mode-realtime catalog_category_flat
php indexer.php --mode-realtime catalog_category_product
php indexer.php --mode-realtime catalogsearch_fulltext
php indexer.php --mode-realtime cataloginventory_stock
php indexer.php --mode-realtime tag_summary
Restart Cloud DB, MYSQL, and HTTPD
Madness I know, but now we are looking at a non-bandaged solution.
Rather than just increasing my RAM/HD/BOX allocation I would really appreciate some feedback on my current configuration, along with any suggestions as to how to improve response time and reduce overall load.
Particulars:
Magento Community 1.6.2
Apache build with NGINX serving static content (and configured to be used as a reverse proxy server).
M2ePro (most active connection requests - used to sync Amazon/ebay orders/listing/revisions/inventory)
Server Details:
Box:
CentOS 6.3
4096 MB RAM
160 GB Disk (40% Disc Utilization)
Cloud DB:
2 GB RAM
3 GB Disk Current DB size (expanded) 1.7 GB
Pertinent Installed Software Info:
Apache 2.2.15
NGINX 0.91
PHP 5.3.3
MYSQL 5.1.66
Magento Caching Options:
APC Caching
Memcache
Server my.cnf Details:
query-cache-size= 64M
query-cache-limit = 8M
innodb_buffer_pool_size = 1000M
query_cache_size= 64M
default-storage-engine = InnoDB
thread_concurrency = 6
innodb_thread_concurrency = 6
max-connections = 100
Money/time are limited so I would like to figure out if they would best be spent:
1) Continuing to focus on the optimization of currently allocated resources.
2) Leasing another cloud server, and set up NGINX load balancing
3) Loading Apache onto a few in house boxes (DSL connected) for the purpose of CPU load balancing.
4) Some other option I am not thinking of. Any and all useful suggestions are very much appreciated.
Thank You!