OpenVZ virtualization and CPU count
Sometimes when you have the TDS installed on an OpenVZ-based VPS, TDS runtime detects CPUs count in the
virtualization container as equal to the number of the CPUs of the whole server box. This number is usually quite big, in low hundreds. As the runtime creates a
scheduler thread for each CPU, this could quickly hit the system limitations and result in various failures, such as for example inability of the TDS to start or restart.
To fix this, you need to explicitly instruct the TDS runtime to use exact CPUs count, usually 1 to 4, depending on your VPS plan.
You can set this number in the /opt/bosstds/boss.config file using the {vm_args, "+S 1"} parameter - for 1 logical CPU. Change 1 to the actual number of CPUs in your VPS.
nano /etc/bosstds/boss.config
Find the line that read as follows:
{compiler_options, [no_debug_info, inline_list_funcs, no_line_info]},
add {vm_args, "+S 1"}, line prior to this line, so it would look like this:
{vm_args, "+S 1"},
{compiler_options, [no_debug_info, inline_list_funcs, no_line_info]},
Save with Ctrl+X, S
Restart the TDS
/etc/init.d/bosstds restart
If you cannot restart the TDS because you already hit the limits, do either reboot of the VPS or find the process ID of the BossTDS with command pgrep beam and then kill it with kill [process number]