Optimize linux server prevent OOM

I’ve done numerous optimizations to prevent this freeze.

HTTPD.CONF
Timeout 120
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 2
<IfModule prefork.c>
StartServers       8
MinSpareServers    5
MaxSpareServers   20
ServerLimit      10
MaxClients       10
MaxRequestsPerChild 2000

</IfModule>
<IfModule worker.c>
StartServers         2
MaxClients         150
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0

</IfModule>

my.cnf
log-slow-queries = /myfolder/slow.log
log_slow_queries = 1
long_query_time = 5
query_cache_type = 1
query_cache_size = 16M
thread_cache_size = 4
table_cache = 128
innodb_buffer_pool_size = 12M
log-queries-not-using-indexes = 1

Leave a comment