1

I read some articles about using tmpfs for /tmp and PHP sessions directories for better performance, and it sounds interesting.

I'm using Centos 6 server with LAMP stack (+FastCGI) and in my fcgid.conf I can see two configurations that are responsible for socket files:

FcgidIPCDir /var/run/mod_fcgid

FcgidProcessTableFile /var/run/mod_fcgid/fcgid_shm

Can I (and should I?) move those directories to another location and put those under tmpfs? I can't find any articles about it, but it sounds very reasonable to me, after all it shouldn't be persistent.

Edited: I removed another sub-question.

Thanks :)

Rotem
  • 147
  • 1
  • 14
  • I hardly understand what you mean by *mod_fcgid is handling sessions*. PHP cannot delegate it's session management to httpd. Changing PHP session directory to a volatile storage doesn't seem to be a good idea, though. – sam_pan_mariusz Dec 27 '15 at 15:48
  • As I said, I'm not really sure why the php sessions directory isn't being filled with new sessions, so I thought that it's somehow related to mod_fcgid. Any idea why new session files aren't being created under my session.save_path directory? (I used `lsof +D [path]` to check if new sessions are being created) – Rotem Dec 27 '15 at 15:56
  • Read *phpinfo()* output if the directory is really set (globally and locally). Check directory write permissions with ie. `sudo -u httpd -- touch /path/to/session/file` (substitute correct user for *httpd* - not sure of the exact name for CentOS). – sam_pan_mariusz Dec 27 '15 at 16:20
  • Lets assume that Apache has access to the sessions dir. that's still not answering my question - should I use tmpfs for the fcgi sockets directories? – Rotem Dec 27 '15 at 21:59
  • Yes, you can use it safely for temporary files, including socket directories. But I doubt it can improve performance in this case. – sam_pan_mariusz Dec 28 '15 at 12:00
  • @sam_pan_mariusz why are you in doubt? If it significantly increase performance for PHP sessions, so why won't it do the same for FastCGI sockets? – Rotem Dec 28 '15 at 13:49
  • IPC sockets are typically created only during service startup or restart. Socket files are purely virtual, no data is stored on a disk. It doesn't really matter whether the file is resided on a fast or slow filesystem. – sam_pan_mariusz Dec 28 '15 at 18:00

0 Answers0