Usage

$key

API key for your DreamHost Web Panel. You can generate an API key here. Make sure “All dreamhost_ps functions” is checked to ensure memCron has access to your DreamHost PS settings.

$ps

Name of your PS server, usually in the format of ps12345. You can either get the name of your DreamHost PS here or log into your private server via SSH client and type “hostname” in shell to find out.

$email

Notifications will be sent to this email when $mem_threshold is exceeded.

$disable_updates

If set to 1, memCron will only monitor your memory usage and will not change your memory settings.

Default value: 0

$cron_interval

Number of minutes between calls to memCron script i.e. the interval you used for memCron cron job. Do not put less than 1 min to prevent errors.

Default value: 5

$max_memory

Maximum amount of memory that memCron can request. DreamHost default is 4000 MB.

Default value: 4000

$min_memory

Minimum amount of memory that memCron can request. DreamHost default is 300 MB.

Default value: 300

$mem_threshold

If this threshold is exceeded, memCron will send out an email to notify you (set to 0 to disable this feature).

Default value: 0

$alert_on_change

If set to 1, memCron will send out email notification when memory is changed.

Default value: 0

$alert_on_error

If set to 1, memCron will send out email notification when API generates an error.

Default value: 1

$mem_free_confidence

Confidence level for free memory to be enough until next memCron run. The value must be between 0 and 1, the closer to 1 the more confident you are, but it also increases the amount of free memory to be reserved.

Take note that this value will not be used if $mem_free_to_used_ratio demands a higher memory reserve, vice versa.

Default value: 0.999

$mem_free_to_used_ratio

Minimum free vs. used memory ratio you are comfortable with i.e. free memory / used memory. The higher you set this value the less likely swap memory will be utilized, and thus the more reliable your site will be i.e. less internal server error.

FYI, swap memory is the “burstable” portion of memory provided by DreamHost and should only be utilized to accommodate unforeseen spikes.

Default value: 2.0

$downsize_resistance

Minimum number of consecutive requests to lower memory limit before memCron actually does it. You can increase this value if memCron keeps running out of daily resize limit, which is 30 times/day at the moment.

Setting this to a higher value reduces the responsiveness of memory downsize i.e. your memory size will stay high for a period of time before it drops down when usage is low.

Default value: 12

$num_data

Number of past data to be used to estimate free memory required. The highest value you should set this is one day worth of data, which is 288 for a 5 minutes cron interval.

The default value of 80, which corresponds to roughly 7 hours worth of data, should be good enough for most users.

Default value: 80

$num_data_csv

Number of data to be stored in the csv file used to generate pretty graphs. This sets the maximum amount of data that can be plotted on the graph.

Default value: 4000

DreamHost PS Memory Manager