Comments please on AWS EC2 instance for SWI-Prolog, specifications?

I have set up an AWS EC2 instance to run SWI-Prolog. It will be running as a PEngines server on Ubuntu 18.04 LTS using SWI-Prolog 8.0.3. I chose to install the version available via apt-get instead of compiling it myself. Here are the specs on the instance (i.e. - virtual machine):

Type: t2.micro
Memory: 1GB (890MB free with the SWI-Prolog console loaded)
SSD drive: 30GB

My server code does not load any large tables or data sets. It’s is several thousands of lines of codes. I don’t anticipate storing more than 1 to 2 thousand facts in the dynamic database at any point in time.

Will this unit have enough horsepower to run SWI-Prolog in PEngines mode along with my code?

Also, if any of you have run SWI-Prolog on an AWS EC2 instance and have any tips for me, please share. I’m especially interested in tips that involve avoiding unnecessary performance or throughput bottlenecks.

Also, were there any custom alerts you found useful that helped you learn about the the CPU being close to an overload condition, due to a surge in server traffic? Did you set up something like Monit to request utilization statistics periodically on the instance?

1 Like

It is really hard to say how much power you need. The question is not much different that “I have a Tomcat web server, how much power do I need?” It all depends on the the workload. It is useful to run a recent 8.1.x version as this branch solves quite a few memory and stability issues. The memory issues mostly relate to running many wildly different programs using Pengines as used by the public SWISH instance.

If you have any idea on your workload you could of course try to simulate. If not, just hope for the best and have a plan B in case you need to scale up quickly. That is what the cloud is for :slight_smile: Success!

Thanks Jan. What is the most stable of the 8.1.x version, and can I get that version via apt-get or do I need to go the compilation route (on Ubuntu 18.04 LTS)?

Probably 8.1.20. There are also some relevant patches afterwards, but from there on there is a quite significant set of changes that gave rise to some regression issues. Still, public SWISH runs 8.1.23 and ran for well over a week until it crashed last night on a regression related to rational numbers.

I think you can install older versions from the PPA service. Don’t ask me how though.

1 Like

Thanks for the version number. I’ll investigate the PPA issue.