Problems with slow performance in a vps.

Hi people,

This its my first time here, so hi to all people, and excuse my poor english (

This its my question:

I have a smf discussion board with around 400 concurrent users, at 300 the performance seems fine, but above it become imposible.
The mysql its wrong optimized?

Im in a VPS with 640mb RAM, i have eAccelerator installed.

Thanks in advance and best regards! )

i attach some info:

Image Virtuozzo 1/2


Image Virtuozzo 2/2

WHM server infoProcessor InformationProcessor #1 Vendor: AuthenticAMDProcessor #1 Name: AMD Opteron™ Processor 248Processor #1 speed: 2193.728 MHzProcessor #1 cache size: 1024 KBProcessor #2 Vendor: AuthenticAMDProcessor #2 Name: AMD Opteron™ Processor 248Processor #2 speed: 2193.728 MHzProcessor #2 cache size: 1024 KBCurrent Memory Usage total used free shared buffers cachedMem: 2097152 371372 1725780 0 0 0-/+ buffers/cache: 371372 1725780Swap: 0 0 0Total: 2097152 371372 1725780

# top

top - 15:17:56 up 4 days, 16 min, 1 user, load average: 1.41, 1.63, 1.73Tasks: 71 total, 4 running, 67 sleeping, 0 stopped, 0 zombieCpu(s): 13.5% us, 1.4% sy, 0.0% ni, 84.1% id, 0.9% wa, 0.0% hi, 0.0% siMem: 2097152k total, 317104k used, 1780048k free, 0k buffersSwap: 0k total, 0k used, 0k free, 0k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 9453 nobody 15 0 35868 12m 7468 S 12.0 0.6 0:04.63 httpd13943 nobody 16 0 36004 12m 7324 R 1.9 0.6 0:09.50 httpd13480 nobody 16 0 35152 9068 4496 R 1.6 0.4 0:00.05 httpd13902 nobody 15 0 35708 13m 8424 S 1.0 0.6 0:10.49 httpd11325 mysql 15 0 177m 40m 3612 S 0.6 2.0 143:54.06 mysqld13894 nobody 15 0 35724 11m 7000 S 0.3 0.6 0:08.46 httpd13944 nobody 15 0 35644 11m 6396 S 0.3 0.5 0:11.30 httpd 5203 nobody 15 0 35652 10m 5908 S 0.3 0.5 0:01.82 httpd12080 nobody 15 0 32036 6872 3348 S 0.3 0.3 0:00.05 httpd12129 root 15 0 1832 952 752 R 0.3 0.0 0:00.06 top 1 root 15 0 1476 544 472 S 0.0 0.0 0:01.58 init 6050 root 15 0 1464 524 440 S 0.0 0.0 0:01.49 syslogd 9669 named 18 0 47456 2824 1872 S 0.0 0.1 0:19.05 named 9682 root 16 0 3652 924 668 S 0.0 0.0 0:00.00 sshd 9692 root 16 0 2016 772 636 S 0.0 0.0 0:00.35 xinetd 9713 root 15 0 6760 4824 1468 S 0.0 0.2 0:12.87 chkservd 9789 mailnull 16 0 6776 1932 1564 S 0.0 0.1 0:01.14 exim 9800 mailnull 16 0 6752 1892 1532 S 0.0 0.1 0:00.03 exim 9806 root 16 0 3404 1224 832 S 0.0 0.1 0:08.13 antirelayd10017 root 16 0 32284 29m 2300 S 0.0 1.4 0:10.01 spamd10086 root 15 0 1516 588 496 S 0.0 0.0 0:00.44 crond10118 root 17 0 2056 1052 900 S 0.0 0.1 0:00.00 mysqld_safe11453 root 16 0 5864 1328 1036 S 0.0 0.1 0:00.25 pure-ftpd11471 root 16 0 3556 908 720 S 0.0 0.0 0:00.00 pure-authd

my.cnf

[mysqld]skip-lockingcharacter-sets-dir=/usr/share/mysql/charsets/query_cache_limit=3Mquery_cache_size=48Mquery_cache_type=2max_user_connections=50max_connections=150interactive_timeout=60wait_timeout=30connect_timeout=10thread_cache_size=96thread_concurrency=2key_buffer=16Mjoin_buffer=1Mmax_allowed_packet=8Mtable_cache=1024record_buffer=1Msort_buffer_size=1024Kread_buffer_size=1024Kmax_connect_errors=10read_rnd_buffer_size=1024Kmyisam_sort_buffer_size=16Msocket=/var/lib/mysql/mysql.sock[mysql.server]user=mysqlbasedir=/var/lib[safe_mysqld]open_files_limit=4096[mysqldump]quickmax_allowed_packet=8Mmax_allowed_packet=8M[mysql]no-auto-rehash[isamchk]key_buffer=16Msort_buffer=16Mread_buffer=8write_buffer=8M[myisamchk]key_buffer=16Msort_buffer=16Mread_buffer=8Mwrite_buffer=8M[mysqlhotcopy]interactive-timeout

MySQL 4.1.22-standard uptime 4 2:22:14 Mon Mar 24 17:24:42 2008__ Key _______________________________________________________________Buffer used 14.16M of 16.00M %Used: 88.48 Current 16.00M %Usage: 99.99Write hit 38.40%Read hit 99.95% Questions _______________________________________________________Total 18.10M 51.1/s DMS 17.51M 49.4/s %Total: 96.73 COM_QUIT 296.69k 0.8/s 1.64 Com 294.34k 0.8/s 1.63 -Unknown 10 0.0/s 0.00Slow (10) 379 0.0/s 0.00 %DMS: 0.00 Log: OFFDMS 17.51M 49.4/s 96.73 SELECT 16.39M 46.3/s 90.56 93.62 UPDATE 828.59k 2.3/s 4.58 4.73 INSERT 112.17k 0.3/s 0.62 0.64 REPLACE 103.49k 0.3/s 0.57 0.59 DELETE 73.20k 0.2/s 0.40 0.42Com 294.34k 0.8/s 1.63 change_db 286.26k 0.8/s 1.58 lock_tables 2.36k 0.0/s 0.01 unlock_tabl 2.36k 0.0/s 0.01 SELECT and Sort ___________________________________________________Scan 1.80M 5.1/s %SELECT: 10.99Range 569.06k 1.6/s 3.47Full join 35.32k 0.1/s 0.22Range check 1 0.0/s 0.00Full rng join 0 0/s 0.00Sort scan 920.53k 2.6/sSort range 41.33k 0.1/sSort mrg pass 521 0.0/s Query Cache _______________________________________________________Memory usage 8.63k of 48.00M %Used: 0.02Block Fragmnt 100.00%Hits 0 0/sInserts 1 0.0/sInsrt:Prune 1:1 0/sHit:Insert 0.00:1 Table Locks _______________________________________________________Waited 27.87k 0.1/s %Total: 0.14Immediate 20.29M 57.3/s Tables ____________________________________________________________Open 370 of 1024 %Cache: 36.13Opened 1.20k 0.0/s Connections _______________________________________________________Max used 41 of 150 %Max: 27.33Total 297.64k 0.8/s Created Temp ______________________________________________________Disk table 9.13k 0.0/sTable 13.83k 0.0/s Size: 32.0MFile 1.05k 0.0/s Threads ___________________________________________________________Running 1 of 12Cached 29 of 96 %Hit: 99.99Created 41 0.0/sSlow 2 0.0/s Aborted ___________________________________________________________Clients 1.89k 0.0/sConnects 0 0/s Bytes _______________________________________________________________Sent 3.88G 11.0k/sReceived 3.25G 9.2k/s

# free -m

total used free shared buffers cachedMem: 2048 352 1695 0 0 0-/+ buffers/cache: 352 1695Swap: 0 0 0

Welcome to our forums )

First of all, as it’s Virtuozzo VPS, could you please post here output of the following command:

cat /proc/user_beancounters

It will print list of VPS resources and their limits, and it can help to ensure that the problem is not caused by low VPS resource limits.

Hi pnyco,

I think the first problem may come from Apache as I see this line:
9453 nobody 15 0 35868 12m 7468 S 12.0 0.6 0:04.63 httpd
(this process takes 12% CPU, and about 12m of memory)

Try to optimize your Apache configuration first.

One more thing is from your application as I see there’re so many full joins and temp disk tables created in the mysqlreport report. You may need to create some more indexes or to re-write some queries to use indexes. It depends much on your application.

The last thing comes from MySQL:

  • seem key_buffer_size need to be increased, let try with 20M.
  • query cache may be reduced to 32M or less. Block Fragmnt is 100.00%, try to reduce the query_cache_min_res_unit to 1024. And also I don’t understand why you use “demand caching” as your query_cache_type=2. Change it to 1 may help (it depends on your application).

Hope this help.

Thanks for the replys and thanks for the welcome )

uid resource held maxheld barrier limit failcnt 3364: kmemsize 19125193 19149834 2147483647 2147483647 0 lockedpages 0 0 2147483647 2147483647 0 privvmpages 124293 125445 2147483647 2147483647 0 shmpages 4827 4827 2147483647 2147483647 0 dummy 0 0 2147483647 2147483647 0 numproc 129 129 2147483647 2147483647 0 physpages 65332 66089 2147483647 2147483647 0 vmguarpages 0 0 2147483647 2147483647 0 oomguarpages 65332 66089 2147483647 2147483647 0 numtcpsock 60 71 2147483647 2147483647 0 numflock 5 5 2147483647 2147483647 0 numpty 1 1 2147483647 2147483647 0 numsiginfo 10 18 2147483647 2147483647 0 tcpsndbuf 701540 858060 2147483647 2147483647 0 tcprcvbuf 983040 1130496 2147483647 2147483647 0 othersockbuf 24152 100236 2147483647 2147483647 0 dgramrcvbuf 0 0 2147483647 2147483647 0 numothersock 25 29 2147483647 2147483647 0 dcachesize 720619 733577 2147483647 2147483647 0 numfile 41106 41106 2147483647 2147483647 0 dummy 0 0 0 0 0 dummy 0 0 0 0 0 dummy 0 0 0 0 0 numiptent 298 298 2147483647 2147483647 0

I will try to optimize apache, and i will try your mysql tips Safari, thanks alot!

best regards.