Digital Ocean Notes

I’m experimenting with Digital Ocean for servers. Here are notes.

0. Use “FREE” for true memory usage

Don’t mistake what TOP tells you to be the real memory usage. Try free instead.

The -/+ buffers/cache line is a more realistic memory usage.

1. By default, Ubuntu 14 droplets lack SWAP

https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

It’s recommended to use 2x RAM for swap, at least for systems with less RAM (i.e. 512 MB). The benefit of more than 2 GB of swap may not be much (since what you’re doing *should* fit in RAM for optimal performance anyway).

2. Install LiteSpeed from Source

NOTE: You need to use the Beta series (14.x) for PHP 7 support.

https://www.digitalocean.com/community/tutorials/how-to-install-the-openlitespeed-web-server-on-ubuntu-14-04

PHP is installed through the control panel (i.e. port 7080). Default deployment port is 8088.

You can upgrade to PHP versions not presently listed in the control panel like so:

Simply edit the name (i.e. PHP7.0.0beta1 to PHP7.0.0RC2).

If you’re having troubles retrieving the file from mirrors, you can manually wget the file.

To compile PHP, you may need some additional dependencies like mcrypt (source).

After installing, go to Server Config->External App and change the Command to lsapi7.

(sidenote) Prefer GraphicsMagick to ImageMagick

A fork of ImageMagick optimized for performance and memory usage.

http://www.graphicsmagick.org/

Universally it’s considered the better of the two, but one article suggested that PSD files are extra slow to process (but only PSD). Internally use GD library to check file size/dimensions before spawning a GraphicsMagick process.

3. Installing APCu on PHP 7