I have a Linux CENTOS server that is very low on its resources (consider for example an AWS MicroInstance). I have on this server 3 PHP Applications and MySQL Server instance running. I require to run multiple recurring jobs for my application that requires to send emails, cleanup process and generate thumbnails. I do not want to slow down the server. Would it be right to run my task as a CRON or as a JAR built using Java in this scenario or should I look at something entirely outside this server?
Share
As I commented, Use
cronthru acrontabentry, perhaps withnice.I don’t believe that making a Java program which would mostly sleep and runs indefinitely for that purpose is a good idea: it will use resources (swap space, processes). And it could be more brittle: if that Java process would stop (for any reason), you won’t find out.
If your Java program is rather small and follow some old specification of the language, you might even consider compiling it ahead-of-time perhaps with gcj into a small ELF executable.