Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #31  
Old 16th October 2010, 12:06
drewb0y drewb0y is offline
Senior Member
 
Join Date: Sep 2010
Posts: 103
Thanks: 10
Thanked 14 Times in 7 Posts
Default

I was doing some more reading on this and it seems that of the 3 accelerators, APC is about right in the middle performance wise but comes out way on top stability and future support wise.

http://stackoverflow.com/questions/9...ator-vs-xcache
http://2bits.com/articles/benchmarki...ng-drupal.html
http://2bits.com/articles/benchmarki...-compared.html
http://www.scribd.com/doc/88689/apcfacebook

Apparently facebook uses APC and also contributes code back to the project which pretty much settles it for me.

Install was only 2 steps (OK 3 if you count restarting Apache)

Code:
apt-get install php-apc
Code:
vi /etc/php5/conf.d/apc.ini
add the following to apc.ini
Code:
extension=apc.so
apc.enabled=1
apc.shm_size=30
Restart apache and done.
__________________
ISPConfig 3.0.5.4p1 - The Perfect Server - Debian Wheezy (nginx, BIND, Dovecot, ISPConfig 3)
Installed on Debian 7.6 on a KVM VPS
Reply With Quote
Sponsored Links
  #32  
Old 16th October 2010, 12:51
Antennipasi Antennipasi is offline
ISPConfig Developer
 
Join Date: Dec 2008
Location: Finland
Posts: 67
Thanks: 6
Thanked 13 Times in 12 Posts
Default

Quote:
Originally Posted by drewb0y View Post
I was doing some more reading on this and it seems that of the 3 accelerators, APC is about right in the middle performance wise but comes out way on top stability and future support wise.

Apparently facebook uses APC and also contributes code back to the project which pretty much settles it for me.
These are reasons why we are using it too.
Also PHP6 will have accelerator build-in, and based on APC.
Reply With Quote
  #33  
Old 17th October 2010, 01:35
Turbanator Turbanator is offline
Senior Member
 
Join Date: Jun 2008
Posts: 217
Thanks: 21
Thanked 16 Times in 16 Posts
Default

crypted:

i wanted to throw in my 2 cents when it came to your mysql usage. If you're having high traffic on a few wordpress sites, I'm guessing you're having large load in mysql too.

Can you try increasing your key_buffer_size from 16M to something closer to your index size...like 128M (now that you're at 4G Ram) and report back after a restart and 2 days usage? I like to start higher and drop it down if it's overkill.

My other thought is your temp tables. Poor queries (and any query running over fulltext searches), will end up in temp tables which are tables written to disk. A major drain on resources. Decreasing your slow query time from 10 sec to 5 sec will probably show more of those queries so you can analyze and tweak them.
Reply With Quote
  #34  
Old 17th October 2010, 03:55
crypted crypted is offline
Senior Member
 
Join Date: Dec 2006
Location: Oklahoma, USA
Posts: 429
Thanks: 3
Thanked 14 Times in 6 Posts
Default

Yeah, I've been tweaking it every day and half. What's 44 hours vs. 48 hours really? So anyway, I've changed many-a-setting with SQL and it's gotten a lot better.

I tweaked it again this afternoon; I'll report back with those results the next day or two.

But, RAM + PHP CACHING + SQL TWEAKS = 0.36 avg load.
__________________
ISPC3 on Debian! It's great!
Reply With Quote
  #35  
Old 17th October 2010, 11:11
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,736 Times in 2,571 Posts
Default

This link might help as well: http://www.howtoforge.com/tuning-mys...ith-mysqltuner
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #36  
Old 17th October 2010, 19:52
crypted crypted is offline
Senior Member
 
Join Date: Dec 2006
Location: Oklahoma, USA
Posts: 429
Thanks: 3
Thanked 14 Times in 6 Posts
Default

Falko: good tutorial to have. I've been using PRIMER and TUNER. I realize they are different in their suggestions, but having both does help get a good sensibility for what's needed.

I really recommend using caching on high PHP websites after this. SQL was the next issue and it's pretty well resolved I think.
__________________
ISPC3 on Debian! It's great!
Reply With Quote
  #37  
Old 17th October 2010, 23:13
Turbanator Turbanator is offline
Senior Member
 
Join Date: Jun 2008
Posts: 217
Thanks: 21
Thanked 16 Times in 16 Posts
Default

Here's another tool I use in addition to the above:
http://hackmysql.com/mysqlreport
Reply With Quote
  #38  
Old 27th October 2010, 00:45
crypted crypted is offline
Senior Member
 
Join Date: Dec 2006
Location: Oklahoma, USA
Posts: 429
Thanks: 3
Thanked 14 Times in 6 Posts
Default

Today, we had a few minute lockup but I wasn't at home to observe it.

My CPUWAIT hit 198.
http://monitor.derekgordon.com/munin...n.com-cpu.html

My processes average 198, however at the time of this occurrence the processes was over 360.

Swap was utilized during this time. First time since the RAM increase to 4GB that this happened.
http://monitor.derekgordon.com/munin....com-swap.html

MYSQL has been tweaked and should be pretty good.
Here's the output of the tuner.sh:
Code:
MySQL Version 5.0.51a-24+lenny4-log x86_64

Uptime = 3 days 0 hrs 57 min 33 sec
Avg. qps = 384
Total Questions = 100897230
Threads Connected = 10

Server has been running for over 48hrs.
It should be safe to follow these recommendations

To find out more information on how each of these
runtime variables effects performance visit:
http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html
Visit http://www.mysql.com/products/enterprise/advisors.html
for info about MySQL's Enterprise Monitoring and Advisory Service

SLOW QUERIES
The slow query log is enabled.
Current long_query_time = 10 sec.
You have 55472 out of 100898023 that take longer than 10 sec. to complete
Your long_query_time seems to be fine

BINARY UPDATE LOG
The binary update log is NOT enabled.
You will not be able to do point in time recovery
See http://dev.mysql.com/doc/refman/5.0/en/point-in-time-recovery.html

WORKER THREADS
Current thread_cache_size = 8
Current threads_cached = 3
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine

MAX CONNECTIONS
Current max_connections = 200
Current threads_connected = 9
Historic max_used_connections = 76
The number of used connections is 38% of the configured maximum.
Your max_connections variable seems to be fine.

INNODB STATUS
Current InnoDB index space = 64 K
Current InnoDB data space = 64 K
Current InnoDB buffer pool free = 98 %
Current innodb_buffer_pool_size = 64 M
Depending on how much space your innodb indexes take up it may be safe
to increase this value to up to 2 / 3 of total system memory

MEMORY USAGE
Max Memory Ever Allocated : 649 M
Configured Max Per-thread Buffers : 1.07 G
Configured Max Global Buffers : 232 M
Configured Max Memory Limit : 1.30 G
Physical Memory : 3.87 G
Max memory limit seem to be within acceptable norms

KEY BUFFER
Current MyISAM index space = 134 M
Current key_buffer_size = 16 M
Key cache miss rate is 1 : 395
Key buffer free ratio = 15 %
You could increase key_buffer_size
It is safe to raise this up to 1/4 of total system memory;
assuming this is a dedicated database server.

QUERY CACHE
Query cache is enabled
Current query_cache_size = 150 M
Current query_cache_used = 54 M
Current query_cache_limit = 24 M
Current Query cache Memory fill ratio = 36.20 %
Current query_cache_min_res_unit = 4 K
MySQL won't cache query results that are larger than query_cache_limit in size

SORT OPERATIONS
Current sort_buffer_size = 2 M
Current read_rnd_buffer_size = 256 K
Sort buffer seems to be fine

JOINS
Current join_buffer_size = 3.00 M
You have had 4 queries where a join could not use an index properly
You should enable "log-queries-not-using-indexes"
Then look for non indexed joins in the slow query log.
If you are unable to optimize your queries you may want to increase your
join_buffer_size to accommodate larger joins in one pass.

Note! This script will still suggest raising the join_buffer_size when
ANY joins not using indexes are found.

OPEN FILES LIMIT
Current open_files_limit = 1810 files
The open_files_limit should typically be set to at least 2x-3x
that of table_cache if you have heavy MyISAM usage.
Your open_files_limit value seems to be fine

TABLE CACHE
Current table_cache value = 800 tables
You have a total of 386 tables
You have 498 open tables.
The table_cache value seems to be fine

TEMP TABLES
Current max_heap_table_size = 375 M
Current tmp_table_size = 375 M
Of 153649 temp tables, 32% were created on disk
Perhaps you should increase your tmp_table_size and/or max_heap_table_size
to reduce the number of disk-based temporary tables
Note! BLOB and TEXT columns are not allow in memory tables.
If you are using these columns raising these values might not impact your 
ratio of on disk temp tables.

TABLE SCANS
Current read_buffer_size = 128 K
Current table scan ratio = 1749 : 1
read_buffer_size seems to be fine

TABLE LOCKING
Current Lock Wait ratio = 1 : 1666
You may benefit from selective use of InnoDB.
I would venture a guess this is to do with rampant apache/fcgi processes. However, I changed FCGI to 1 child as Till suggested.

Have a raw.gz collectl for that day. Honestly, I can't figure out how to get it to display information in the terminal worth anything. It just floods everything and screws up my terminal connection.

Help appreciated.
__________________
ISPC3 on Debian! It's great!
Reply With Quote
  #39  
Old 27th October 2010, 03:35
crypted crypted is offline
Senior Member
 
Join Date: Dec 2006
Location: Oklahoma, USA
Posts: 429
Thanks: 3
Thanked 14 Times in 6 Posts
Default

Apparently it's all related to fcgid. The processes continue to spawn even though I have the Max set to 1 as Till suggested.

My load has been a constant 2-3 avg the past two hours. Namely it's php-cgi (fastcgi) that's doing the eating.

Code:
mysql    15381  6.7  2.9 416660 120856 pts/1   Sl   20:40   3:24 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mys
root     15382  0.0  0.0   5040   668 pts/1    S    20:40   0:00 logger -p daemon.err -t mysqld_safe -i -t mysqld
postfix  16961  0.0  0.0  38900  2288 ?        S    20:50   0:00 pickup -l -t fifo -u -c
root     17097  0.0  0.4 330864 17196 ?        Ss   20:53   0:00 /usr/sbin/apache2 -k start
root     17098  0.0  0.1  39188  6916 ?        S    20:53   0:00 vlogger (access log)
www-data 17099  0.0  0.1 170056  5320 ?        S    20:53   0:00 /usr/sbin/apache2 -k start
www-data 17100  0.0  0.3 332128 12396 ?        S    20:53   0:02 /usr/sbin/apache2 -k start
web5     17105  5.5  1.8 272388 73556 ?        R    20:53   2:06 /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web5/web:
web5     17137  6.8  1.7 270096 71096 ?        S    20:53   2:34 /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web5/web:
web11    17184  0.1  1.3 266256 55208 ?        S    20:54   0:02 /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web11/web
web1     17212  0.2  2.4 284140 101260 ?       S    20:54   0:05 /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web1/web:
web7     17562  0.0  1.3 263636 55780 ?        S    20:55   0:01 /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web7/web:
web8     17688  6.3  1.9 279888 81276 ?        S    20:57   2:08 /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web8/web:
www-data 18153  0.0  0.3 332516 12564 ?        S    21:00   0:00 /usr/sbin/apache2 -k start
web11    18279  0.0  1.3 263892 54904 ?        S    21:03   0:01 /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web11/web
web8     18869 12.4  1.8 271824 74228 ?        S    21:06   3:08 /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web8/web:
web8     18875 17.7  1.8 271808 73208 ?        S    21:06   4:27 /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web8/web:
web8     18878 11.1  1.8 272296 73916 ?        R    21:06   2:47 /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web8/web:
root     19546  0.0  0.0  10560  2196 pts/1    T    21:13   0:00 nano /home/dingle/collectl.output.log
web9     20052  0.0  1.1 261224 47412 ?        S    21:17   0:00 /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web9/web:
web9     20053  0.0  1.1 260956 47264 ?        S    21:17   0:00 /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web9/web:
amavis   20106  0.0  0.2 192480  8524 ?        S    21:18   0:00 amavisd (virgin child)
web29    20124  0.0  1.3 267280 56724 ?        S    21:18   0:00 /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web29/web
web29    20125  0.0  1.4 267272 57292 ?        S    21:18   0:00 /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web29/web
www-data 20174  0.0  0.3 332104 12348 ?        S    21:19   0:00 /usr/sbin/apache2 -k start
www-data 20179  0.0  0.3 332136 12372 ?        S    21:19   0:00 /usr/sbin/apache2 -k start
www-data 20184  0.0  0.3 332104 12324 ?        S    21:19   0:00 /usr/sbin/apache2 -k start
www-data 20598  0.0  0.3 332504 12496 ?        S    21:21   0:00 /usr/sbin/apache2 -k start
www-data 20599  0.0  0.3 332128 12300 ?        S    21:21   0:00 /usr/sbin/apache2 -k start
web5     20609  1.7  1.9 276432 77288 ?        S    21:21   0:10 /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web5/web:
web5     20610  3.8  1.9 276444 77320 ?        S    21:21   0:22 /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web5/web:
nobody   20954  0.0  0.0  28184  2712 ?        S    Oct25   1:22 /usr/local/sbin/mydns -b
web8     21141 14.2  1.7 271808 73140 ?        S    21:26   0:45 /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web8/web:
web8     21146  6.5  1.7 271816 73088 ?        S    21:26   0:20 /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web8/web:
web8     21149 23.8  1.7 271812 73088 ?        S    21:26   1:14 /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web8/web:
web8     21150  1.1  1.7 271812 73032 ?        S    21:26   0:03 /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web8/web:
web8     21151  2.2  1.7 271808 73080 ?        S    21:26   0:06 /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web8/web:
web8     21155 12.1  1.7 271808 73140 ?        S    21:26   0:37 /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web8/web:
web8     21159 16.8  1.7 271808 73128 ?        S    21:26   0:51 /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web8/web:
www-data 21207  0.0  0.2 332064 11988 ?        S    21:27   0:00 /usr/sbin/apache2 -k start
www-data 21215  0.0  0.3 332112 12260 ?        S    21:27   0:00 /usr/sbin/apache2 -k start
www-data 21216  0.0  0.2 332112 12168 ?        S    21:27   0:00 /usr/sbin/apache2 -k start
www-data 21221  0.0  0.3 332388 12500 ?        S    21:27   0:00 /usr/sbin/apache2 -k start
postfix  21223  0.0  0.1 106484  6112 ?        S    21:27   0:00 smtpd -n smtp -t inet -u -c -o stress 
postfix  21226  0.0  0.0  38900  2244 ?        S    21:27   0:00 anvil -l -t unix -u -c
web8     21238  4.1  1.9 277936 81056 ?        S    21:27   0:09 /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web8/web:
web8     21244  2.6  1.9 277820 80944 ?        S    21:27   0:05 /usr/bin/php-cgi -d open_basedir=/var/www/clients/client1/web8/web:
amavis   21362  0.0  0.2 192480  8380 ?        S    21:29   0:00 amavisd (virgin child)
postfix  21546  0.0  0.0  38900  2224 ?        S    21:30   0:00 showq -t unix -u -c
www-data 21797  0.0  0.2 331920 11788 ?        S    21:30   0:00 /usr/sbin/apache2 -k start
www-data 21802  0.0  0.2 331788 11768 ?        S    21:30   0:00 /usr/sbin/apache2 -k start
root     21849  0.0  0.0  16016  1116 pts/1    R+   21:31   0:00 ps aux
root     22363  0.0  0.0      0     0 ?        S    Oct25   0:09 [pdflush]
__________________
ISPC3 on Debian! It's great!
Reply With Quote
  #40  
Old 27th October 2010, 04:32
Turbanator Turbanator is offline
Senior Member
 
Join Date: Jun 2008
Posts: 217
Thanks: 21
Thanked 16 Times in 16 Posts
 
Default

Do you have any recent fcgi processes die in your error.log?

I wonder if the processes are spawning because they are waiting on mysql. I still have concern over your long queries being over 10 sec. It tells me that those are probably mysql writing a temp table out to disk...and disk tables for a busy server like yours are deadly. (still just a theory...but it would be interesting to see your disk access read/write during those maxcpu times.) This is related to if your website has a lot of fulltext searches.

Are these custom queries or a packaged script?

I would also increase your key_buffer_size to at least 128M and see how it goes. I keep mine the same rough size as my index files. You can reduce it once you solve some problems.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problems with suexec gobokster Installation/Configuration 7 7th May 2009 13:33
Question about the hardware requirement for mysql cluster with load balancing??? johN5Five^ HOWTO-Related Questions 3 12th April 2007 17:06
Mandriva 10.2 Perfect Setup Install Problems... ctroyp Installation/Configuration 12 30th December 2005 16:04
Apache with MYSQL trouble mandarin14 Installation/Configuration 4 4th December 2005 20:18
MySQL 5.0 and Apache 2.0.xx Lil'Brudder General 2 11th November 2005 01:08


All times are GMT +2. The time now is 11:12.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.