-
Notifications
You must be signed in to change notification settings - Fork 4
II.3. Speeding up
See I.7. nginx configuration for an nginx configuration example.
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.
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.