1

I am trying to make my prestashop faster, I made some benchmark with ab:

(VirtualBox with Debian 7.1 + Nginx 1.4 + Mysql 5.6)

  • Php 5.4 + APC ==> 3 req/sec
  • Php 5.5 + ZOP+ ==> 4,5 req/sec

With the all the code inside a TMPFS mount :

  • Php 5.4 + APC ==> 12 req/sec
  • Php 5.5 + ZOP+ ==> 24 req/sec

So the gain is big ! I am wondering if its a good thing or not to use a TMPFS mount for execute PHP?

Thomas Decaux
  • 21,738
  • 2
  • 113
  • 124
  • http://en.wikipedia.org/wiki/Tmpfs ==> On reboot, everything in tmpfs will be lost. This partition type is not for what you want to do. You should ask on superusers. – kmas Oct 07 '13 at 09:23
  • Sure ! I dont want to store data on tmpfs, just execute Php. The mount is sync via a rsync method, everything is fine, I am just wondering why all hosting guys dont do that? – Thomas Decaux Oct 07 '13 at 10:06
  • 1
    You should really ask on superuser.com, I think the answers will be better there. Maybe there are some security or memory leaks ? – kmas Oct 07 '13 at 10:14
  • Have You figured that out? I tried to move cache folder into ram disc but I failed. – Eryk Wróbel Aug 10 '20 at 13:18

1 Answers1

0

Hard to guarantee consistency between restarts. The db part can be crucial. But it depends on your app/situation.

Lajos Veres
  • 13,595
  • 7
  • 43
  • 56
  • I am using Prestashop, there are lot of files included in the PHP code, and apparently tmpfs mount make the site run like a rocket ^^ The mount is sync via rsync or scp, and data backed by Mysql and Memcache. – Thomas Decaux Oct 07 '13 at 10:09
  • 1
    I think probably tmpfs made only faster the mysql's internal fsync system calls... Theoretically it is the only slow thing. (slow means waiting for disk, if there is enough memory.) Anyway you can achieve similar result with mysql tuning. Probably with innodb_flush_method=async_unbuffered or something similar. The other parts of the system should go anyway by memory. – Lajos Veres Oct 07 '13 at 10:45