Skip to content
This repository has been archived by the owner on Aug 6, 2022. It is now read-only.

II.3. Speeding up

Andrey Bogdanov edited this page May 21, 2016 · 15 revisions

Serving static content with the help of an HTTP server

See I.7. nginx configuration for an nginx configuration example.

Multiple CPU cores

ololord.js scales very well if you increase the number of CPU cores. By default, one Node.js worker process is spawned per CPU core. You may specify the number of worker processes using the configuration option:

{
    "system": {
        "workerCount": 2
    }
}

Note: Each worker process uses RAM, so the total required RAM increases each time you increase the worker process count.

RAM disk

Another way to improve ololord.js performance is storing temporary form parsing data on a RAM disk.

To create a RAM disk on UNIX-like OS, type the following in the console:

RAMDISK_MOUNT_PATH=/path/to/ramdisk # Something like "/mnt/ramdisk"
RAMDISK_SIZE=100M # Or more/less (note the "M" - it means "Megabytes")

mkdir $RAMDISK_MOUNT_PATH
chmod 777 $RAMDISK_MOUNT_PATH

mount -t tmpfs -o size=$RAMDISK_SIZE tmpfs $RAMDISK_MOUNT_PATH

Now specify the cache path in config.json:

{
    "system": {
        "tmpPath": "/path/to/ramdisk"
    }
}

For a small board with 1-2 posts/hour 100 MB will be pretty enough. For a large board with many boards and high posting speed you may need up to 1 GB of ramdisk space.

Clone this wiki locally