Page 1 of 1

How do you reboot the TNG service?

Posted: Sun Jun 27, 2021 11:28 am
by Paul Barrett
I ran geocoding process that sent the server into a spin with a 504 gateway timeout error. That was hours ago but it's still unresponsive

The NAS itself is under no stress (6% CPU, 6% RAM).

How do I stop and start the service?

Does TNG have a parameter like WordPress does to set a RAM allocation? If so where is it please?

Re: How do you reboot the TNG service?

Posted: Sun Jun 27, 2021 11:49 am
by steven
You cannot reboot the TNG service as TNG is running from PHP and uses MariaDB. Log in to DSM and go to the package center. Select the version of PHP you are using to run TNG. Then select stop. Once PHP has stopped, simply start it again. This procedure can be used for any package that hangs on your NAS.

Re: How do you reboot the TNG service?

Posted: Mon Jun 28, 2021 8:38 am
by Paul Barrett
Perfect. Thanks Steve

Can I reserve more RAM for php to use?

Re: How do you reboot the TNG service?

Posted: Mon Jun 28, 2021 10:08 am
by steven
Keep in mind the NAS OS and various packages require a certain amount of ram as well. To check how much ram is on your NAS, log in to DSM, select Control Panel and the select Info Center. About line six you will see the total physical memory on your machine.

To change the PHP memory limit go to Web Station. Select PHP Settings and then select the PHP version you want to change and click Edit. Then select the Core tab. Scroll down to memory_limit. The default value is 128M. This value limits the memory used by each PHP script running on your machine.

I have never had to set this value higher than 128M. Keep in mind if you increase this value and have multiple programs running the same PHP profile, memory will be increased for all of them. If you are using virtual hosts you can increase the memory for one PHP program by creating a unique PHP profile. Modify the memory for that profile and then assign it to the host that runs the PHP program requiring more memory. You can also uncheck extensions that are not required to save more memory.

If you make changes you should periodically monitor your NAS to ensure you did not create a problem. The easiest way to do this is use the DSM widgets. If you are not familiar with the widgets, the widget icon is located at the upper right corner of the DSM desktop screen.

Image

If you do not have any widgets, click the plus sign in the upper left corner.

Image

The pop menu will show the available widgets.

Image

I recommend using System Health because it shows the overall status of your DiskStation.

Image

To monitor RAM, select Resource Monitor which will show the CPU and RAM usage as well as the LAN transfer rate.

Image

To remove any widget, click the plus sign and then select the widget to remove.

Note that increasing the PHP memory limit will not eliminate 504 timeout errors. In some cases you can reduce these errors by running TNG in NGINX.
Since your program ran for "hours" without completing, I suspect there is something amiss with the geocode program. Well behaved programs usually time themselves out after a certain time period releasing resources and then exiting.