Boosted LAMP for Drupal devs

Submitted by vadim on Wed, 07/11/2012 - 16:05

In one on my previous posts I wrote how to configure Drupal development environment in Ubuntu, in this post I am going to talk about performance on your localhost (PAE, APC and MySQL tuning). There is also another blog post about Tuning Drupal Performance for production which is a bit different thing.

My old laptop was broken last days so I quickly found a cheap replacement, which had a bit different insides: two AMD cores VS four Intell i3 cores and 4GB vs 3GB. I decided to try Linux Mint, which is said is better then Ubuntu. IMO for LAMP stack the name of the Linux distribution is not so important, because they are all working good now :) But you should decide which version of one to chose: 32 bit or 64 bit. In this post I found out that 64 bit Linux is better for development, but it could be not good enough for some applications, which could fail running on 64 bit Linux.

Memory utilization for 32 bit Linux

I decided to chose 32 bit version of Mint. But the first thing I noticed was 2.6GB of RAM was only available. That looked very weird and that was one of disadvantage of 32 bit system. When I was running full LAMP stack + IDE + Skype I saw almost almost all memory was used and some disk space were taken for swap. Fortunately good people wrote Physical Address Extension (PAE) which could be installed with the following command:

$ sudo apt-get install linux-generic-pae linux-headers-generic-pae

That worked good and then System Monitor showed 3.5 GB of RAM. Still not 4, but it could be a unit conversion issue. I am glad that swap is not being used and system is working faster now.

Configuring Alternative PHP Cache

A bit later I cloned a big project and I saw how hardly my machine was trying to handle requests, which used to slow down the system. So the way out was to install APC. Alternative PHP Cache is a free, open source framework that optimizes PHP intermediate code and caches data and compiled code from the PHP bytecode compiler in shared memory. In Mint or Ubuntu it could be installed with following command:

$ sudo apt-get install php-apc

Then I made sure that /etc/php5/conf.d/apc.ini file is in place and overrode default settings:

extension=apc.so
apc.shm_size=128M
apc.max_file_size=10M

Then I installed APC module for Drupal that allows to store Drupal cache in memory instead of database. That should give me huge performance increase. I made sure that the size of project cache tables was less then shm_size in config file, enabled APC module and added following lines into settings.php file:

$conf['cache_backends'] = array('sites/all/modules/apc/drupal_apc_cache.inc');
$conf['cache_default_class'] = 'DrupalAPCCache';
$conf['page_cache_without_database'] = TRUE;
$conf['page_cache_invoke_hooks'] = FALSE;

See module's readme to check for more options.

MySQL tuning

Despite APC cache was enabled, it was not affecting on the database performance, so I needed to change settings of MySQL to make it work faster. Below are values which I overrode in MySQL configuration files.

/etc/mysql/mysql.cnf:

[mysqld]
key_buffer              = 128M
max_allowed_packet      = 128M
max_connections        = 300
table_cache             =  256
query_cache_limit       = 16M
query_cache_size        = 128M

/etc/mysql/conf.d/innodb.cnf:

[mysqld]
innodb_buffer_pool_size = 1024M
innodb_additional_mem_pool_size = 32M
#innodb_log_file_size = 16M
innodb_log_buffer_size = 4M
innodb_flush_log_at_trx_commit = 2
innodb_thread_concurrency = 4
innodb_flush_method = O_DIRECT
innodb_file_per_table = 1

Check out what do those settings mean.

Conclusion

Finally I had up to 100% increase in performance. I have not tried to change my HD to SSD yet, but I am sure, it will gain even more performance. BTW, here is an interesting manual, they use it to perform automated tests. It does even allow to run MySQL in memory instead of disk. Enjoy!

If you are interested in performance increase for your production website you can check out my other post Tuning Drupal Performance.

349 comments

Eye Secrets

Submitted by Eye Secrets (not verified) on Thu, 04/24/2014 - 09:46.

Though beauty gives you a weird sense of entitlement, it's rather frightening and threatening to have others ascribe such importance to something you know you're just renting for a while.Eye Secrets

start potty training reviews

Submitted by start potty training reviews (not verified) on Thu, 04/24/2014 - 04:00.

Mega-events have thus become occasions for experiments in monitoring people and places. And, start potty training reviews

This is such a great

Submitted by Anonymous (not verified) on Wed, 04/23/2014 - 20:05.

This is such a great information for me, because i do an online job thats why i need fast Internet connection, i search how to bost internet speed then ireach at a right place. visit the site

Great conclusion to end up in

Submitted by jams (not verified) on Wed, 04/23/2014 - 15:52.

Great conclusion to end up in this article for releasing a depth of knowledge and making us a more broad thinkers now
write my paper

Nicely presented information

Submitted by Anonymous (not verified) on Tue, 04/22/2014 - 21:49.

Nicely presented information in this post, I prefer to read this kind of stuff. The quality of content is fine and the conclusion is advantage Thanks. pittsburghseo.marketing1on1.com

Thanks a lot for sharing

Submitted by Crystal X (not verified) on Tue, 04/22/2014 - 17:47.

This is such a great information for me, because i do an online job thats why i need fast Internet connection, i search how to bost internet speed then ireach at a right place.
Crystal X Asli
Ciri Crystal X Asli
Efek Samping Crystal x

This is such a great

Submitted by Anonymous (not verified) on Sun, 04/13/2014 - 13:12.

This is such a great information for me, because i do an online job thats why i need fast Internet connection, i search how to bost internet speed then ireach at a right place. SEO expert New York

null

Submitted by anchor (not verified) on Tue, 04/22/2014 - 12:25.

This is a very good post. Just wonderful. Truly, I am amazed at what informative things you’ve told us today.See more

This is such a great

Submitted by Anonymous (not verified) on Sun, 04/13/2014 - 13:06.

This is such a great information for me, because i do an online job thats why i need fast Internet connection, i search how to bost internet speed then ireach at a right place. birra ipa

This is such a great

Submitted by Anonymous (not verified) on Sun, 04/13/2014 - 13:00.

This is such a great information for me, because i do an online job thats why i need fast Internet connection, i search how to bost internet speed then ireach at a right place. Fall Protection Equipment

This is such a great

Submitted by Anonymous (not verified) on Sun, 04/13/2014 - 12:19.

This is such a great information for me, because i do an online job thats why i need fast Internet connection, i search how to bost internet speed then ireach at a right place. go to this site

This is such a great

Submitted by Anonymous (not verified) on Sun, 04/13/2014 - 12:05.

This is such a great information for me, because i do an online job thats why i need fast Internet connection, i search how to bost internet speed then ireach at a right place. find more info

This is such a great

Submitted by Anonymous (not verified) on Sun, 04/13/2014 - 11:25.

This is such a great information for me, because i do an online job thats why i need fast Internet connection, i search how to bost internet speed then ireach at a right place.see post

This is such a great

Submitted by Anonymous (not verified) on Sun, 04/13/2014 - 11:18.

This is such a great information for me, because i do an online job thats why i need fast Internet connection, i search how to bost internet speed then ireach at a right place. click to read

This is such a great

Submitted by Anonymous (not verified) on Sun, 04/13/2014 - 11:06.

This is such a great information for me, because i do an online job thats why i need fast Internet connection, i search how to bost internet speed then ireach at a right place.try this out

This is such a great

Submitted by Anonymous (not verified) on Sun, 04/13/2014 - 10:59.

This is such a great information for me, because i do an online job thats why i need fast Internet connection, i search how to bost internet speed then ireach at a right place.look at this site

garcinia cambogia before and after

Submitted by garcinia cambogia before and after (not verified) on Sun, 04/13/2014 - 00:58.

I really enjoyed it…and i really appreciate to you for this….its always pleasure to read so….Thanks for sharing!!garcinia cambogia before and after

This is just the information

Submitted by Anonymous (not verified) on Sat, 04/12/2014 - 20:22.

This is just the information I am finding everywhere. Thanks for your blog, I just subscribe your blog. This is a nice blog. seo backlinks

IMO for LAMP stack the name

Submitted by kevin789 (not verified) on Sat, 04/12/2014 - 19:29.

IMO for LAMP stack the name of the Linux circulation is not so imperative, in light of the fact that they are all working great now :) But you ought to choose which form of one to picked: 32 bit or 64 bit. In this post I figured out that 64 bit Linux is better for advancement, yet it could be bad enough for a few requisitions, which could fall flat running on 64 bit Linux. If you want appropriate solution about Phoenix Electriican please feel free to visit our site.

I am preparing a research

Submitted by Anonymous (not verified) on Sat, 04/12/2014 - 17:19.

I am preparing a research paper and collecting information on this topic. Your post is one of the better that I have read. assurance emprunteur

client experience training

Submitted by client experience training (not verified) on Sat, 04/12/2014 - 11:28.

I am agree with your topic.I Just saying thank you will not just be enough, for the wonderful lucidity in your writing. client experience training

www.rebelmouse.com

Submitted by www.rebelmouse.com (not verified) on Sat, 04/12/2014 - 00:52.

That's the material which I was searching about. The matter you've highlighted above is surely valuable for anyone. www.rebelmouse.com

Exclusive electronic

Submitted by lenceria fina (not verified) on Sat, 04/12/2014 - 14:35.

Exclusive electronic cigarettes with or without nicotine. Secure and certified products makes all the difference

Well I really love how it is

Submitted by green essay (not verified) on Sat, 04/12/2014 - 23:39.

Well I really love how it is easy on my eyes and the information are well written. I am wondering how I might be notified whenever a new post green essay

Exclusive electronic

Submitted by 7 days to die server mieten (not verified) on Sat, 04/12/2014 - 14:33.

Exclusive electronic cigarettes with or without nicotine. Secure and certified products makes all the difference.

I enjoyed your entries on Toxic Words

Submitted by falloutexpart (not verified) on Sat, 04/12/2014 - 22:23.

I am happy to be here because this is a very good site that provides lots of information about the topics covered in depth. I’m glad to see that people are actually writing about this issue in such a smart way.
wedding loan

This is such a great

Submitted by Anonymous (not verified) on Fri, 04/11/2014 - 20:17.

This is such a great information for me, because i do an online job thats why i need fast Internet connection, i search how to bost internet speed then ireach at a right place. seo companies in los angeles

criminal attorney nyc

Submitted by criminal attorney nyc (not verified) on Fri, 04/11/2014 - 18:24.

topic and ignored by so many, even professionals. professionals. I thank you to help making people more aware of possible issues. criminal attorney nyc

vitalikor reviews

Submitted by vitalikor reviews (not verified) on Fri, 04/11/2014 - 15:29.

I demand this column to plenary my chore in the university, also it has invariable text among your piece. Blesss, renowned allotment. vitalikor reviews

Such a very useful article.

Submitted by Anonymousaaa (not verified) on Fri, 04/11/2014 - 15:27.

Such a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. online allure formula

Such a very useful article.

Submitted by Anonymousaaa (not verified) on Fri, 04/11/2014 - 14:16.

Such a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. fatty liver diet guide dorothy spencer book

Such a very useful article.

Submitted by Anonymous (not verified) on Fri, 04/11/2014 - 13:26.

Such a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. https://www.rebelmouse.com/onlineallureformulareviews/

I am always searching online

Submitted by Anonymous (not verified) on Fri, 04/11/2014 - 11:04.

I am always searching online for articles that can help me. There is obviously a lot to know about this. I think you made some good points in Feat ures also. Keep working, great job! https://www.rebelmouse.com/crackthegirlcodereviews/

roofing cambridge ma

Submitted by roofing cambridge ma (not verified) on Fri, 04/11/2014 - 07:04.

It’s possible to make homemade frozen yogurt without using a machine! Here are links to some of our favorite homemade frozen yogurt recipes. roofing cambridge ma

This is exactly what I was

Submitted by Anonymous (not verified) on Thu, 04/10/2014 - 21:26.

This is exactly what I was looking for. Thanks for sharing this great article! dermatology phoenix

Nice photos too bad you

Submitted by 7 days to die server mieten (not verified) on Thu, 04/10/2014 - 10:55.

Nice photos too bad you downloaded them from Internet photos and added in your own captions. But the public wouldn't know better right.

SEO services Montreal

Submitted by SEO services Montreal (not verified) on Thu, 04/10/2014 - 08:39.

Interesting post. I Have Been wondering about this issue, so thanks for posting. Pretty cool post.It 's really very nice and Useful post.Thanks SEO services Montreal

This is such a great

Submitted by Anonymous (not verified) on Wed, 04/09/2014 - 21:14.

This is such a great information for me, because i do an online job thats why i need fast Internet connection, i search how to bost internet speed then ireach at a right place. seo-philadelphia.com

it could be negative

Submitted by Anonymous (not verified) on Fri, 04/11/2014 - 13:51.

it could be negative estimable sufficient for several petitions, which could sink running on 64 morsel Linux.
gclub casino

garcinia cambogia

Submitted by garcinia cambogia (not verified) on Wed, 04/09/2014 - 14:02.

The best thing about this website is that all files are free to use and undetectable.garcinia cambogia

Thanks a lot for sharing. You

Submitted by garcinia cambogia dr (not verified) on Thu, 04/10/2014 - 07:01.

Thanks a lot for sharing. You have done a brilliant job. Your article is truly relevant to my study at this moment, and I am really happy I discovered your website. garcinia cambogia dr oz

Uçak Bileti Bul

Submitted by Uçak Bileti Bul (not verified) on Wed, 04/09/2014 - 17:37.

Gidiş dönüş Uçak Bileti Satın Almak

Gidiş dönüş Uçak Bileti satın almak için ilerleyebileceğiniz 2 farklı yol vardır;

1. İnternet üzerinden gidiş dönüş uçak bileti satışı yapan bir siteden gidiş dönüş uçak bileti satın almak

2. Uçak bileti satışı yapan bir firmadan gidiş dönüş uçak bileti satın almak

İnternet üzerinden gidiş dönüş uçak bileti satın almak:

İnternet erişimi olan bir bilgisayardan arama motoruna gidiş dönüş uçak bileti kelimesini aratarak gidiş dönüş uçak bileti satışı yapan bir siteye girmeniz gerekmektedir. Siteden gidiş dönüş uçak bileti seçeneğini seçerek uçuş güzergahınızı belirlemeniz gerekmektedir. Daha sonraki aşama olarak uçuş gidiş dönüş uçuş tarihinizi seçim bilet satın alma butonuna tıklamalısınız. Siteye kredi kartı bilgilerinizi girerek gidiş dönüş uçak biletinizi alabilirsiniz. Bu aşamadan sonra yapmanız gereken gidiş dönüş uçak biletinde yer alan uçuş saatinden en az bir saat önce havalimanında olmak. Havalimanında bulunan kontuar bölümüne giderek gidiş dönüş uçak biletinizin check-in işlemini gerçekleştirmeniz gerekmekte. Görevlilerden gidiş dönüş uçak biletinizi alıp uçağınızın yanaşacağı kapıya gitmeniz yeterli olacaktır. İniş saatiniz satın aldığınız gidiş dönüş uçak biletinizin üzerinde yer alıyor olacaktır.

Well , is still among the

Submitted by dayz server mieten (not verified) on Wed, 04/09/2014 - 12:03.

Well , is still among the leading topics of our time. I appreciate your post and look forward to more.Video review about the best place

Orange County bail bonds

Submitted by Orange County bail bonds (not verified) on Wed, 04/09/2014 - 11:53.

Really impressed! Everything is very open and very clear clarification of issues. Orange County bail bonds

Tarleton and took theater

Submitted by Anonymous (not verified) on Thu, 04/10/2014 - 00:00.

Tarleton and took theater classes! Goooo, Socar P! Are the Purple Pooh still haunting your nightmares?0 down lease

https://www.archive.org/

Submitted by https://www.archive.org/ (not verified) on Tue, 04/08/2014 - 16:27.

You might comment on the demonstration of the blog. You should say that it's first-class. Your blog recap shall swell up your capital. buy repins You might comment on the demonstration of the blog. You should say that it's first-class. Your blog recap shall swell up your capital. buy repins https://www.archive.org/

thanks for information Kursi

Submitted by Kursi Tamu (not verified) on Tue, 04/08/2014 - 18:09.

thanks for information Kursi Tamu Minimalis

Wow, this was a really

Submitted by PPI Claims (not verified) on Tue, 04/08/2014 - 12:27.

Wow, this was a really quality post. In theory I’d like to write like this too – taking time and actual effort to make a good post…

Drupal cache in memory

Submitted by Anonymous (not verified) on Wed, 04/09/2014 - 01:56.

Drupal cache in memory instead of database. That should give me huge performance increase. essay writer

I decided to try Linux Mint,

Submitted by descargar counter strike 1.6 (not verified) on Tue, 04/08/2014 - 13:57.

I decided to try Linux Mint, which is said is better then Ubuntu. IMO for LAMP stack the name of the Linux distribution is not so important, because they are all working good now.
descargar counter strike 1.6