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.

902 comments

Pretty good post. I just

Submitted by Anonymous (not verified) on Sun, 07/27/2014 - 18:38.

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. voyance en direct

cheap elo boost

Submitted by Anonymous (not verified) on Sun, 07/27/2014 - 21:59.

This website has very good content. Please let me know if you're looking for a article author for your weblog. So I am sure this website will form the well-known in the future. Someone I work with visits your blog regularly and recommended it to me to read also.cheap elo boost

I made sure to bookmark your

Submitted by anymous (not verified) on Sun, 07/27/2014 - 00:28.

I made sure to bookmark your website so I can come back later. I enjoyed every moment of reading it. doc to html

I got here much interesting

Submitted by anymous (not verified) on Sat, 07/26/2014 - 14:10.

I got here much interesting stuff. The post is great! Thanks for sharing it! cheap brochure printing

Please let me know if you're

Submitted by best boots for women (not verified) on Sun, 07/27/2014 - 16:36.

Please let me know if you're looking for a article author for your weblog. You have some really great posts and I feel I would be a good asset. If you ever want to take some of the load off, I'd love to write some material for your blog in exchange for a link back to mine. Please shoot me an email if interested.best boots for women

Easily, the article is

Submitted by Anonymous (not verified) on Sat, 07/26/2014 - 13:34.

Easily, the article is actually the best topic on this registry related issue. I fit in with your conclusions and will eagerly look forward to your next updates. https://www.rebelmouse.com/60secondpanicsolutionreviews/

Congratulation for the great

Submitted by anymous (not verified) on Sat, 07/26/2014 - 13:28.

Congratulation for the great post. Those who come to read your Information will find lots of helpful and informative tips. Article

Thank you for this post.

Submitted by Anonymous (not verified) on Sat, 07/26/2014 - 10:41.

Thank you for this post. Thats all I are able to say. You most absolutely have built this blog website into something speciel. You clearly know what you are working on, youve insured so many corners. www.rebelmouse.com/

Thank you! I am find

Submitted by best epilator for women (not verified) on Sun, 07/27/2014 - 16:38.

Thank you! I am find information on this topic as I am working on a business project. How did you get to be this great? Its remarkable to see someone put so much passion into a subject.best epilator for women

Easily, the article is

Submitted by Anonymous (not verified) on Fri, 07/25/2014 - 15:24.

Easily, the article is actually the best topic on this registry related issue. I fit in with your conclusions and will eagerly look forward to your next updates. https://www.rebelmouse.com/texttheromancebackmichaelfiore/

Awesom article and post ,

Submitted by Anonymous (not verified) on Fri, 07/25/2014 - 14:47.

Awesom article and post , obviously in your web page everything is outstanding.Thanks for useful and beneficial publish. https://www.rebelmouse.com/howtomakehimdesireyoureview/

This website has very good

Submitted by ninja blender reviews (not verified) on Sun, 07/27/2014 - 16:39.

This website has very good content. Please let me know if you're looking for a article author for your weblog. So I am sure this website will form the well-known in the future. Someone I work with visits your blog regularly and recommended it to me to read also. The writing style is great and the content is top-notch. Thanks for the insight you provide the readers!ninja blender reviews

The problem for many people

Submitted by Anonymous (not verified) on Fri, 07/25/2014 - 12:27.

The problem for many people is that they feel they have some insurmountable obstacles in their way that keeps them from getting started. yeast infection no more

Most of the time I don’t make

Submitted by Anonymous (not verified) on Fri, 07/25/2014 - 10:30.

Most of the time I don’t make comments on but I'd like to say that this article really forced me to do so. Really nice post! details

So, you've posted this

Submitted by Anonymous (not verified) on Fri, 07/25/2014 - 09:14.

So, you've posted this article today? Well, I am really impressed by this. It's got all the information I needed on this topic and the article itself looks very amazing. Brilliant job! Keep it up! boost your bust book

Big thumbs up for making such

Submitted by Belda (not verified) on Thu, 07/24/2014 - 13:14.

Big thumbs up for making such wonderful blog page! https://archive.org/details/TaoOfBadassReview

I would be glad to recommend

Submitted by anymous (not verified) on Thu, 07/24/2014 - 12:42.

I would be glad to recommend the post for its quality content. Nice post. garcinia cambogia

I just couldn't leave your

Submitted by Anonymous (not verified) on Thu, 07/24/2014 - 10:52.

I just couldn't leave your website before telling you that I truly enjoyed the top quality info you present to your visitors? Will be back again frequently to check up on new posts. gold IRA

Very informative post! There

Submitted by Anonymous (not verified) on Thu, 07/24/2014 - 10:41.

Very informative post! There is a lot of information here that can help any business get started with a successful social networking campaign! The Venus Factor reviews

I will be interested in more

Submitted by Anonymous (not verified) on Thu, 07/24/2014 - 10:25.

I will be interested in more similar topics. i see you got really very useful topics , i will be always checking your blog thanks. get rid of dark circles

Your music is amazing. You

Submitted by Anonymous (not verified) on Thu, 07/24/2014 - 09:55.

Your music is amazing. You have very talented artists. I wish you the best of success. www.quadone.com

Thanks for taking the time to

Submitted by Anonymous (not verified) on Thu, 07/24/2014 - 09:48.

Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful for me. sildenafil online

Thanks for some other

Submitted by anymous (not verified) on Thu, 07/24/2014 - 00:06.

Thanks for some other informative blog. The place else may just I get that kind of information written in such a perfect methoddownload FIFA 14 Coin generator

Thanks for sharing this

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

Thanks for sharing this interesting blog with us.My pleasure to being here on your blog..I wanna come beck here for new post from your site. truth about cellulite review

Very informative post! There

Submitted by Anonymous (not verified) on Wed, 07/23/2014 - 19:30.

Very informative post! There is a lot of information here that can help any business get started with a successful social networking campaign! capture his heart and make him love you forever review

This article is really thce

Submitted by Anonymous (not verified) on Wed, 07/23/2014 - 18:33.

This article is really thce best. So, I would like you that you keep on continuing your work on this article. And upload as many new articles about this as possible. text your ex back book

clash-of-clans-hack

Submitted by prem (not verified) on Wed, 07/23/2014 - 19:30.

hello friends you can get free clash of clans game codes and hacks gems through this site....
http://freehacksandcodes.com/clash-of-clans-hack

Hey there thanks for showing

Submitted by Allen (not verified) on Fri, 07/25/2014 - 14:19.

Hey there thanks for showing me this. I must say that your blogpost was the most enjoying read I've seen in a long time. Greetings fromGenerate Bitcoins Online

I was also searching related

Submitted by Allen (not verified) on Fri, 07/25/2014 - 15:24.

I was also searching related stuff from long time.You have solved my problem.Thanks for sharing this great stuff with us High Pagerank Backlinks
buy high pagerank backlinks

I, along with my partner

Submitted by Anonymous (not verified) on Wed, 07/23/2014 - 17:37.

I, along with my partner here, were just wondering if you could tell us the source of the place where you get this all important information from. breakup doctor review

This is my first time at your

Submitted by Madday (not verified) on Wed, 07/23/2014 - 15:57.

This is my first time at your blog and I've really enjoyed looking around. I will come back again in the future to check out some of the other articles. facebook hacker

Binary Options Signals Review

Submitted by Binary Options Signals Review (not verified) on Wed, 07/23/2014 - 12:46.

I cannot thank you enough for the post.Really thank you! Will read on…
Binary Options Signals Review

This article is really the

Submitted by Anonymous (not verified) on Tue, 07/22/2014 - 19:57.

This article is really the best. So, I would like you that you keep on continuing your work on this article. And upload as many new articles about this as possible. only available online

This article is really the

Submitted by Anonymous (not verified) on Tue, 07/22/2014 - 19:01.

This article is really the best. So, I would like you that you keep on continuing your work on this article. And upload as many new articles about this as possible. how can i get a man to fall in love with me

This is such a great

Submitted by Anonymous (not verified) on Tue, 07/22/2014 - 17:57.

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. https://www.rebelmouse.com/ultimateherpesprotocolreviews/

I fit in with your

Submitted by Daniel (not verified) on Tue, 07/22/2014 - 14:26.

I fit in with your conclusions and will eagerly look forward to your next updates. http://www.dietmythsandfacts.com/2013/10/old-school-new-body-user-reviews.html

Some of the tips I get here I

Submitted by garcinia cambogia (not verified) on Tue, 07/22/2014 - 12:57.

Some of the tips I get here I can’t find anywhere else. Thanks garcinia cambogia

Park Place Bellevue Review

Submitted by Park Place Bellevue Review (not verified) on Tue, 07/22/2014 - 12:34.

Basically the same cycle is repeated over and over. It is just how amazing how Mother Nature never manages to fail. Impressive. Thanks Park Place Bellevue Review

When I was running full LAMP

Submitted by bellewaters (not verified) on Tue, 07/22/2014 - 01:21.

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.
bellewaters

Price Gallagher is just one

Submitted by Anonymous (not verified) on Thu, 07/24/2014 - 15:39.

Price Gallagher is just one of many peopel around the world taking notice of the many innovations being developed at the Hebrew University. payday advance

I was waiting for this type

Submitted by yetta (not verified) on Tue, 07/22/2014 - 11:51.

I was waiting for this type article and I have gained some useful information from this site. Thanks for sharing this information. Keep blogging.
Download free movies torrents

This has got to be one of the

Submitted by Anonymous (not verified) on Tue, 07/22/2014 - 00:48.

This has got to be one of the most informative article that I've ever read. I've read lots of article but not one of them gave me such important information as this one gave me. Just keep going like this! API 510

Thank you very much

Submitted by Wanda (not verified) on Mon, 07/21/2014 - 19:25.

Mencari dress muslimah menjelang hari raya itu sepertinya sudah menjadi kewajiban. Jika anda mencari baju pesta yang murah meriah dan sesuai dengan nilai-nilai Islami maka anda bisa menemukannya pada website kami. Silahkan kunjungi website busana muslimah kami berikut ini. jual dress pesta muslimah . di sini anda bisa melihat beragam model yang tersedia kunjungi website kami .
Kalau anda tertarik untuk membuat kue takoyaki pada hari raya idul fitri, maka anda bisa mempelajari caranya dari blog kami. Di situ kami membahas cara membuat takoyaki dengan gratis. Anda tidak perlu membeli lisensi apapun untuk membuka usaha takoyaki. Kami juga sudah menyiapkan peralatan yang anda butuhkan bagaimana membuat takoyaki . dan resepnya pun kami bagikan di sini silahkan baca selengkapnya .
Tas laptop bisa membantu anda membawa laptop ke mana-mana dengan aman. Tas laptop yang baik harus bisa melindungi isinya dari segala cuaca dan jika bisa meminimalisir dampak benturan. Ada banyak sekali model dari tas laptop saat ini yang bisa anda pilih. desain tas laptop keren . jika nada tertarik melihat ragam model tas laptop yang kami sediakan klik di sini .
Untuk memeriahkan pesta anda biasanya orang akan bernyanyi, jika anda tidak menghafal liriknya tentu saja bisa membuat malu. Jadi ada baiknya anda mempelajari lirik lagu yang trend di bawakan saat hari raya. Untuk melihat lirik apa saja yang tersedia anda bisa mencarinya di Google. koleksi lirik lagu terlengkap . apakah anda mencari lirik lagu tertentu read more .
This post about cancer was made to help people understand about the most dangerous disease in this century. You can visit our website to read and give your opinion about this deadly disease. reduce weight program . if you need more information about this skin care product lihat penawaran kami .
Apakah anda suka mendownload lagu dari internet? Kami menyediakan berbagai jenis lagu yang bisa anda download. Jadi jika anda tertarik untuk mendengarkan suatu pilihan lagu tertentu silahkan berkunjung ke website kami. download lagu mp3 gratis . baca di sini untuk daftar website download lagu di indonesia download di sini .
perpustakaan online adalah sebuah website yang menyediakan banyak sekali referensi yang bisa anda pergunakan untuk menjawab permasalahan anda. Silahkan anda membaca apa saja koleksi referensi yang ada di perpustakaan kami ini. website perpustakaan digital . informasi lengkap tentang kepustakaan seputar vitamin baca di sini .
Salah satu obyek wisata dalam negeri adalah kota padang di sumatera barat. Di sini ada banyak sekali obyek wisata yang bisa anda kunjungi dan tentu saja pesona kuliner dari kota padang itu sudah terkenal seantero negeri. Jadi pastikan saat anda berkunjung ke padang anda menggunakan jasa wisata yang terbaik. sewa bus wisata . anda bisa menghubungi kami untuk pemesanan jasa bus wisata kunjungi blog .
Dalam berkendaraan anda harus memperhatikan kondisi dari aki jika tidak maka anda bisa terkena masalah saat aki tiba-tiba soak di tengah jalan. Sekarang ini ada layanan beli aki online yang bisa anda pergunakan jika anda merasa malas untuk ke toko aki. Tinggal memastikan saja aki apa yang hendak anda beli. toko aki online . butuh aki? Tinggal hubungi kami di sini lihat artikel .
Pada saat anda mau membuat sebuah pesta di luar ruangan maka tenda adalah kelengkapan yang harus disediakan. Jika anda berada di wilayah jakarta maka raihan tenda bisa membantu anda karena perlengkapan pesta outdoor yang dimiliki sangat lengkap. sewa tenda untuk berbagai acara . butuh perencanaan pernikahan? baca artikel .
Jika anda ingin menjadi leader di dalam sebuah bisnis seperti mmm maka tentunya anda perlu mengetahui apa saja yang perlu anda lakukan di dalam bisnis tersebut. Jadi anda bisa membaca panduan cara bisnis mmm dari blog indonesia berikut ini. bisnis mmm di indonesia . Apakah anda tertarik dengan konsep ini lihat penjelasan lengkapnya .
Penstabil tegangan atau voltage stabilizer adalah sesuatu yang perlu anda pakai pada peralatan anda jika kualitas listrik di tempat anda tidak begitu baik. Ada beberapa merek dari AVR atau voltage stabilizer yang sudah diakui seperti matsunaga. penstabil tegangan . dapatkan produk voltage stabilizer berkualitas lihat produk .
Jika anda mencari jam tangan yang berkualitas baik itu replika atau original, maka anda bisa mencarinya secara online. Hanya saja saat ini banyak sekali toko online yang tidak lain adalah penipuan. Jadi anda harus membeli jam tangan anda dari toko jam tangan online yang terpercaya. jual jam tangan pria murah desain kw . jika anda suka dengan jam tangan lihat pilihan model yang ada di sini silahkan buka halaman .
Bagaimana tips untuk lulus tes semuanya dibagi di sini. Tes apapun yang anda hadapi selalu saja ada solusinya. Mari lihat berbagai trik yang bisa membantu anda lolos tes cari kerja atau UAN atau tes masuk pergutuan tinggi negeri. tips lulus tes di berbagai tempat . berikut ini adalah link yang menyediakan contoh surat lamaran kerja penjelasan selengkapnya .
Apakah anda membutuhkan jasa konveksi seragam kantor yang berkualitas jika demikian anda bisa mendapatkannya hanya di sini. Sebuah jasa konveksi yang mengutamakan kualitas dan kepuasaan dari pelanggannya. Silahkan hubungi kami bisnis konveksi baju di surabaya . Anda juga bisa mendapatkan jasa konveksi murah. lihat di sini .
Ada banyak sekali penyakit di luar sana yang memerlukan penanganan serius. Hanya saja pengobatan barat cenderung mengakibatkan efek samping. Saat ini tiens menyediakan produk alami yang bisa membantu anda mendapatkan kesembuhan dengan lebih aman. Jadi hubungi website jual online produk herbal tiens. penambah tinggi badan alami . Ini dia yang anda butuhkan untuk menambah tinggi badan anak anda baca selengkapnya .
Dalam membangun sebuah blog yang ramai mendapatkan kunjungan dari banyak orang maka anda bisa mencari banyak tutorial SEO atau search engine optimization. Atau anda juga bisa mempelajari bagaimana cara membuat blog yang baik dan benar. belajar SEO dan blog untuk pemula . silahkan anda pelajari lagi cara membuat facebook, atau twitter, atau blog atau email dan sebagainya. Petunjuknya ada lengkap di sini dan sudah siap untuk anda pelajari. Dapatkan tutorial cara membuat lainnya. http://indexcaramembuat.blogspot.com/ .
Selain itu bagi anda yang menggemari fashion wanita, di sini ada tersedia sepatu wanita dan juga wanita beserta aksesorisnya. Ada banyak sekali model terbaru yang unik-unik, jadi jika anda tertarik silahkan berkunjung ke halaman website kami berikut ini jual sepatu dan baju wanita dengan harga murah . Ini dia yang anda butuhkan untuk menambah tinggi badan anak anda http://www.jualonlinesepatu.com/ .

We offer the highest quality

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

We offer the highest quality unique visitors, from your choice of countries and offer over 200 targeted niches through our targeted website traffic packages. where can i buy garcinia cambogia extract

Get free steam wallet codes and other hacking code at zero cost.

Submitted by aarav (not verified) on Mon, 07/21/2014 - 17:43.

hello,here is exciting offer for getting free steam wallet code, hacking codes and other codes at zero cash on our website. http://free-steamwalletcodes.com/

I really like your blog as

Submitted by anymous (not verified) on Mon, 07/21/2014 - 13:50.

I really like your blog as the followings items are so simple to read and follow. Please keep up the good work. Thanks cheap apartments marrakech

21-eyelash-extension-kits-“here”

Submitted by Anonymous (not verified) on Mon, 07/21/2014 - 21:21.

We are really grateful for your blog post.You will find a lot of approaches after visiting your post.I was exactly searching for.21-eyelash-extension-kits-“here”

Fortunately good people wrote

Submitted by Anonymous (not verified) on Mon, 07/21/2014 - 13:29.

Fortunately good people wrote Physical Address Extension (PAE) which could be installed with the following command:
Mannheim hotel

its really amazing blog.

Submitted by anymous (not verified) on Sun, 07/20/2014 - 20:19.

its really amazing blog. thanks for sharing. please update it with new information empower network

Most of the time I don't make

Submitted by Anonymous (not verified) on Sun, 07/20/2014 - 18:07.

Most of the time I don't make comments on websites, but I'd like to say that this article really forced me to do so. Really nice post. http://rebelmouse.com