0

I've a php symfony application on single server and scaled horizontally with dockers on different nodes. So here I wanted to use a clustered file system for cache and logs for centralizing it and mounting on to docker containers.

I achieved this with glusterfs and tested with one user which worked well. But as the load got increased the application went down and response time was increased and sometimes users will get white screen. I removed glusterfs and used local file system which boosted performance of application and did not see any increase in response time on heavy load. From this, I assume glusterfs is not a good choice as clustered file system for storing cache and logs.

So question is, is there any other file system which do downgrade performance of application?

Thank you.

Swaroop Kundeti
  • 515
  • 4
  • 11
  • 25

1 Answers1

1

Putting Symfony cache and log on a shared FS is indeed a bad idea, as you discovered. Local FS is the way to go there. Though if you go to a multi-server configuration, a few advice:

  • make sure sessions are stored elsewhere, memcached or Redis is IMO the way to go. File sessions are a bottleneck in PHP
  • worst case scenario, if you have to stick with file sessions, make your server IP-balanced ("session sticky" in nginx). Otherwise users will be disconnected.
  • move from log files to a centralized logger, ideally something over UDP (non blocking)
  • some parts of Symfony cache can be moved out of the FS, for event better performances: Doctrine can use different kind of cache (memcache again, APCu...), Symfony basic reverse proxy can be replaced by Varnish.

I don't see much more to say, something more to ask?

romaricdrigon
  • 1,497
  • 12
  • 16