Hacker News new | past | comments | ask | show | jobs | submit login

With PHP (What slack was using at one point for some of the services. I think everything uses Hack now which may still maintain a similar model). Switching directories can be mostly atomic.

PHP-FPM with opcaching doesn't need to access files once all the opcodes are cached (turn off file modification checks in production). When you move the directory, you will restart the service.

Unless a request hits a file that is rarely used and not cached, you should be not receive any errors moving the directories.




My point is that if there is any downtime for the switch, for example restarting a service, it's not atomic. A small percentage of failed requests can still be high in absolute terms for a company like Slack, so why not using a paradigm [1] where you have atomic switch? And also instant rollback.

[1] https://www.martinfowler.com/bliki/BlueGreenDeployment.html


Nginx can hot reload a config file while running that’s pointed at a different directory, or perhaps they’re updating a symlink?


Possible!




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: