php - Memory usage high on server compared to wamp -
lately site (with 260000 posts, 12000 images, 2,360,987 mysql rows , 450.7 mib size) running slow , @ times not loading many mins
i installed debug bar plugin https://wordpress.org/plugins/debug-bar/
memory usage
on server is: 174,319,288 bytes
intel(r) xeon(r) cpu e3-1230 v2 @ 3.30ghz , 16 gb (php: 5.5.23, mysql: 5.6.23, apache 2.4)
even tried disabling plugins doesnt much... comes down 160-163,xxx,xxx bytes
on wamp is : 37,834,920 bytes
(php: 5.5.12, mysql: 5.6.17)
why difference huge? how detect problem?
been using following plugins
acunetix wp security akismet antispam bee cloudflare contact form 7 custom post type ui debug bar login lockdown redirection theme test drive w3 total cache wordpress seo wp-optimize wp missed schedule
my.cnf values above server are
[mysqld] slow-query-log=1 long-query-time=1 slow-query-log-file="/var/log/mysql-slow.log" default-storage-engine = myisam local-infile = 0 innodb_buffer_pool_size = 1g innodb_log_file_size = 256m innodb_file_per_table=1 innodb_stats_on_metadata=0 max_connections=360 wait_timeout=60 connect_timeout = 15 thread_cache_size=20 thread_concurrency=8 key_buffer_size = 1024m join_buffer_size = 2m sort_buffer_size=1m query_cache_limit=64m query_cache_size=128m query_cache_type=1 max_heap_table_size=32m tmp_table_size=32mb table_open_cache=1000 table_definition_cache=1024 open_files_limit=10000 max_allowed_packet=268435456 low_priority_updates=1 concurrent_insert=2 #port = 8881 #innodb_force_recovery=0 #innodb_purge_threads=0
the "server" has apache; accounts (all?) of difference.
windows , unix handle memory differently, , measure differently. so, difference may irrelevant.
the numbers have quoted not big; problem?
"tried restarting server , checked in initial moments" -- that's irrelevant. programs tend grow on time, limit. let's see values in "steady state" typical load.
you have enough ram cache entire dataset in ram. but, due inactivity, of data not touched, hence has not been read cache.
"high" memory usage when swapping. actually, "too high". so, say, 90% "high". numbers near that.
innodb_buffer_pool_size=200m
-- not enough hold entire 450.7mb dataset, but, say, of data not actively used.
edit (after posting of settings)
table_cache=10m
that terrible! won't opening 10 million tables. set 1000.
max_heap_table_size=512m tmp_table_size=512mb
those dangerous. if have multiple connections, each needing tmp table (because of complex query), run out of memory fast. set them down 32m.
innodb_force_recovery=3
comment out line -- used once, removed.
the rest of settings harmless discussion.