1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Understanding SSH script limitations
This guide provides important details regarding the launch and execution of command-line scripts (SSH) on various types of Infomaniak hosting.
Executing scripts via SSH and managing resources
Unlike scripts executed via a web browser, there is generally no strict time limit (timeout) for commands launched via SSH. Your script can therefore theoretically run as long as necessary.
Execution time and persistence
If your SSH session closes (loss of internet connection or terminal closure), the running script will be immediately interrupted.
To avoid this during long tasks, it is recommended to run your scripts in the background or, in the case of a VPS, use terminal multiplexing tools (such as screen, tmux, or the nohup utility). This allows the process to continue its work even after you disconnect.
Resource limits (RAM and CPU)
If time is not limited, hardware resources are.
The execution of your scripts remains subject to the machine's capabilities and its configuration:
- Memory (RAM): if a process consumes more memory than the allowed limit (for example, the
memory_limitof PHP or the available physical RAM), it will be killed by the system to preserve the server's stability. - Processor (CPU): prolonged abusive use of the processor can result in throttling or interruption of the process.
It is possible to adjust these resource limits on dedicated environments (such as Cloud Server). However, on shared hosting, these limits are fixed and non-modifiable to ensure performance for all users hosted on the same server.