LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-03-2004, 12:29 AM   #1
chotgor1
LQ Newbie
 
Registered: Nov 2004
Posts: 3

Rep: Reputation: 0
Apache & MySQL keep becoming unresponsive, tuning?


---------------- BACKGROUND:

H, I have ASUS XP2600 , 512MB RAM, RedHat 9, MySQL 3.23.58, Apache 2.0.40 dedicated server 1 Ethernet card very fast internet connection, running 2 websites..

1. phpbb forum with 700MB database, 14000 registered members, 30-80 constant connected users.. In this forum photo attachments are so often used ..

2. media download site that serves mp3s and mpegs.. most downloaded files are 20-60MB mpegs.. I restricted the number of downloads to certain number and that count restarts in the beginning of every hour.. so every hour 0:00 minute, there is some rush for the users to download media files..

----------------- PROBLEM:

a) I was running the phpbb forum around 1-2 months on the fresh Redhat 9 installation without much of problem.. I moved to this server, so the database and attached files were already in massive size from the beginning.. The server was running very nice & smoothly..

b) I installed my downloads site, and the server started to have problem.. it started to crash once a day, and later on twice a day.. and 2-3 days later it started to become unresponsive almost every hour..

c) Firstly after a reboot its Free Memory starts at 350MB and quickly gets down to 5MB, and after that the CPU load average will start to increase reaching as high as 15-30.. After a while with high load average like that, it stays unresponsive, not answering any more HTTP requests, and the load average will come down to very low like 0.07 shown in below example..
---------------------------------------------------------------------------
00:57:07 up 2:06, 1 user, load average: 0.07, 0.02, 0.52
189 processes: 187 sleeping, 2 running, 0 zombie, 0 stopped
CPU states: 0.1% user 0.0% system 0.0% nice 0.0% iowait 99.8% idle
Mem: 481556k av, 476376k used, 5180k free, 0k shrd, 1644k buff
323948k actv, 0k in_d, 10212k in_c
Swap: 979956k av, 559776k used, 420180k free 209020k cached

PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
3496 root 15 0 1192 1192 868 R 0.1 0.2 0:00 0 top
1 root 15 0 108 76 56 S 0.0 0.0 0:05 0 init
2 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 keventd
3 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kapmd
4 root 34 19 0 0 0 SWN 0.0 0.0 0:00 0 ksoftirqd_CPU0
9 root 25 0 0 0 0 SW 0.0 0.0 0:00 0 bdflush
5 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kswapd
6 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kscand/DMA
7 root 15 0 0 0 0 SW 0.0 0.0 0:05 0 kscand/Normal
8 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kscand/HighMem
10 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kupdated
11 root 25 0 0 0 0 SW 0.0 0.0 0:00 0 mdrecoveryd
15 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kjournald
73 root 25 0 0 0 0 SW 0.0 0.0 0:00 0 khubd
2258 root 17 0 0 0 0 SW 0.0 0.0 0:00 0 kjournald
2596 root 15 0 196 156 112 S 0.0 0.0 0:00 0 syslogd
2600 root 15 0 60 4 0 S 0.0 0.0 0:00 0 klogd
2618 rpc 23 0 80 4 0 S 0.0 0.0 0:00 0 portmap
2637 rpcuser 25 0 80 4 0 S 0.0 0.0 0:00 0 rpc.statd
2704 root 25 0 56 4 0 S 0.0 0.0 0:00 0 apmd
2741 root 15 0 616 520 372 S 0.0 0.1 0:00 0 sshd
2756 root 24 0 152 4 0 S 0.0 0.0 0:00 0 xinetd
2768 root 25 0 164 4 0 S 0.0 0.0 0:00 0 safe_mysqld
2802 mysql 15 0 22844 7992 696 S 0.0 1.6 2:06 0 mysqld
---------------------------------------------------------------------------

d) or in many cases the mysqld becomes unresponsive, saying the /tmp/mysql.sock file cant be found.. "service mysqld restart" will restart the mysqld but it still doesn work until I do "killall -9 mysqld, killall -9 httpd, service mysqld start, service httpd start"..

Please help me on this issue, I have been trying to solve it by myself in last week trying to change different values in httpd.conf, my.conf .. it still persists becoming totally unresponsive every other hour or at least in 2-3 hours..

Thank you very much in advance,
Kun.
 
Old 11-03-2004, 12:57 AM   #2
AutOPSY
Member
 
Registered: Mar 2004
Location: US
Distribution: Redhat 9 - Linux 2.6.3
Posts: 836

Rep: Reputation: 31
smp?

Is this a dual or SMP processor system?
 
Old 11-03-2004, 12:37 PM   #3
chotgor1
LQ Newbie
 
Registered: Nov 2004
Posts: 3

Original Poster
Rep: Reputation: 0
it is a single processor system.

here are the configurations:

-------------------------------------------- /etc/httpd/conf/httpd.conf:

Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15

<IfModule prefork.c>
StartServers 8
MinSpareServers 8
MaxSpareServers 20
MaxClients 50
MaxRequestsPerChild 30
</IfModule>

<IfModule worker.c>
StartServers 2
MaxClients 50
MinSpareThreads 8
MaxSpareThreads 20
ThreadsPerChild 15
MaxRequestsPerChild 10
</IfModule>

<IfModule perchild.c>
NumServers 5
StartThreads 5
MinSpareThreads 3
MaxSpareThreads 5
MaxThreadsPerChild 15
MaxRequestsPerChild 10
</IfModule>

LoadModule access_module modules/mod_access.so
LoadModule auth_module modules/mod_auth.so
LoadModule auth_anon_module modules/mod_auth_anon.so
LoadModule auth_dbm_module modules/mod_auth_dbm.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule include_module modules/mod_include.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule env_module modules/mod_env.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
LoadModule usertrack_module modules/mod_usertrack.so
LoadModule unique_id_module modules/mod_unique_id.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule mime_module modules/mod_mime.so
LoadModule dav_module modules/mod_dav.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule asis_module modules/mod_asis.so
LoadModule info_module modules/mod_info.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
LoadModule imap_module modules/mod_imap.so
LoadModule actions_module modules/mod_actions.so
LoadModule speling_module modules/mod_speling.so
LoadModule userdir_module modules/mod_userdir.so

<IfModule prefork.c>
LoadModule cgi_module modules/mod_cgi.so
</IfModule>

<IfModule worker.c>
LoadModule cgid_module modules/mod_cgid.so
</IfModule>



-------------------------------------------- /etc/my.cnf:

[mysqld]
datadir=/var/lib/mysql
set-variable = max_connections=100
set-variable = max_user_connections=75
set-variable = wait_timeout=15
set-variable = connect_timeout=5
set-variable = max_connect_errors=10
set-variable = thread_cache_size=16
set-variable = key_buffer_size=4M
set-variable = max_allowed_packet=4M
set-variable = table_cache=50
set-variable = join_buffer_size=1M
set-variable = record_buffer=1M
set-variable = sort_buffer=1M
set-variable = myisam_sort_buffer_size=4M
socket = /tmp/mysql.sock
skip-innodb

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
socket = /tmp/mysql.sock

[client]
socket = /tmp/mysql.sock

[mysqldump]
quick
set-variable = max_allowed_packet=4M

[myisamchk]
set-variable = key_buffer=8M
set-variable = sort_buffer=8M
set-variable = read_buffer=4M
set-variable = write_buffer=4M


-------------------------------------------- mysqladmin version:
[root@new root]# mysqladmin version -u root -p
Enter password:
mysqladmin Ver 8.23 Distrib 3.23.58, for redhat-linux-gnu on i386

Server version 3.23.58
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /tmp/mysql.sock
Uptime: 12 hours 22 sec

Threads: 1 Questions: 1255527 Slow queries: 49 Opens: 6647 Flush tables: 1 Open tables: 50 Queries per second avg: 29.048
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware guide for AMP Apache MySQL & PHP xushi Slackware 35 05-11-2006 11:18 AM
From RedHat9 to FreeBSD (Apache 2 & Mysql & PHP 4) guardian653 *BSD 5 12-11-2003 05:31 PM
tuning mysql nakkaya Linux - Software 2 03-20-2003 05:28 AM
Apache & PHP & Mysql thomas050682 Linux - Networking 5 03-03-2003 03:21 PM
Apache & Php & MySql te_conway Linux - Software 2 12-21-2001 04:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration