There is Ubuntu Server 16.04.1 x64 with 512 Mb on board.
Parallel Rails-launched project sometimes runs tasks that need additional RAM. For this, it was decided to apply SWAP.
And everything seems to be normal, but sometimes the site (when apparently its blocks from RAM are moved to disk) begins to "think" slightly, and sometimes it works quickly. Though in both cases task hung.
Is it possible to prioritize somehow, they say, that the Rails project always lies in its native RAM, and also goes into SWAP if it needs to, but does Rails tasks always lie in SWAP?
All this works from one user. Tasks run CRON on a schedule.
Is it generally possible to implement without much hemorrhoids?