Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Sep 25, 2015 6:59 am 
Offline
Junior Member
User avatar

Joined: Wed Apr 11, 2012 8:46 am
Posts: 31
Website: http://www.neomallers.com
Location: Toronto Canada
I upgraded from ubuntu 10.04 lts 32 bit to 12.04 lts 64 bit a month or two ago so not sure if that is the cause, but im noticing there is massive lag which eventually lead to an internal server error 500. It happens alot when one of the WP sites get to around 30 users. (it was fine with 130 before on 10.04.. just a little slow) Restarting PHP5-fpm or mysql will cause the server to come back online. The static stuff (html, css, pictures) work fine.. anything that invokes mysql hangs (it eventually comes back and dies again. rinse and repeat) Is anyone able to provide some insight? Thanks!! //linux semi n00b
P.S. I can also provide other details if needed
Server is running Apache2, Php5-fpm (fastcgi), (2gb linode)

Code:
Apache/2.2.22 (Ubuntu) mod_fastcgi/mod_fastcgi-SNAP-0910052141 mod_fcgid/2.3.6


FPM SETTINGS
Code:
pm.max_requests = 200
pm = ondemand
pm.max_children =16
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 2



MySQL (my.cnf)
Code:
key_buffer      = 64M
max_allowed_packet   = 16M
thread_stack      = 256K
thread_cache_size       = 8
#CUSTOM ADJUSTMENTS
open_files_limit = 5000
query_cache_size=16M
tmp_table_size = 16M
max_heap_table_size = 16M
table_cache = 500
innodb_buffer_pool_size=512M
max_connections = 150
expire_logs_days   = 10
max_binlog_size         = 100M


MySqlTuner

Code:
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.5.44-0ubuntu0.12.04.1
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -------------------------------------------
[--] Status: -Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 257M (Tables: 706)
[--] Data in InnoDB tables: 1G (Tables: 953)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
[!!] Total fragmented tables: 969

-------- Performance Metrics -------------------------------------------------
[--] Up for: 8h 43m 41s (2M q [93.855 qps], 29K conn, TX: 57B, RX: 731M)
[--] Reads / Writes: 84% / 16%
[--] Total buffers: 624.0M global + 2.8M per thread (150 max threads)
[OK] Maximum possible memory usage: 1.0G (51% of installed RAM)
[OK] Slow queries: 0% (0/2M)
[OK] Highest usage of available connections: 8% (13/150)
[OK] Key buffer size / total MyISAM indexes: 64.0M/17.8M
[OK] Key buffer hit rate: 99.9% (1M cached / 2K reads)
[OK] Query cache efficiency: 89.2% (2M cached / 2M selects)
[!!] Query cache prunes per day: 281907
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 66K sorts)
[!!] Temporary tables created on disk: 32% (10K on disk / 31K total)
[OK] Thread cache hit rate: 99% (18 created / 29K connections)
[!!] Table cache hit rate: 16% (500 open / 3K opened)
[OK] Open file limit used: 11% (551/5K)
[OK] Table locks acquired immediately: 99% (394K immediate / 394K locks)
[!!] InnoDB data size / buffer pool: 1.2G/512.0M

-------- Recommendations -----------------------------------------------------
General recommendations:
    Run OPTIMIZE TABLE to defragment tables for better performance
    MySQL started within last 24 hours - recommendations may be inaccurate
    Enable the slow query log to troubleshoot bad queries
    When making adjustments, make tmp_table_size/max_heap_table_size equal
    Reduce your SELECT DISTINCT queries without LIMIT clauses
    Increase table_cache gradually to avoid file descriptor limits
Variables to adjust:
    query_cache_size (> 16M)
    tmp_table_size (> 16M)
    max_heap_table_size (> 16M)
    table_cache (> 500)
    innodb_buffer_pool_size (>= 1G)


Top
   
PostPosted: Sun Oct 04, 2015 11:20 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
I am not very familiar with php-fpm, but my understanding is that the number of fpm servers should be around 1x to 2x the number of CPUs on your machine. Run cat /proc/cpuinfo to see how many CPUs you have and adjust max_children, start_servers, and max_spare_servers accordingly.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group