SSL Errors in the Memory Manager

2

I’ve been contacted by several users of the memory manager application regarding the following error showing up in logs:

error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed'

This is due to the ssl certificate for the API having expired, something I’m sure DH will be fixing soon. In the meantime I used the opportunity to push out the latest version of the memory manager application with a work around for ignoring the expired cert. A couple of bug fixes (IE users should show the graphs properly now) and code cleanup went into this version.

Download is found to the right, or on the project’s github page here:

https://github.com/jgalvez/JJs-DH-VPS-Memory-Manager

Enjoy!

1 year ago

Mostly for my personal notes, but this is useful to anyone who works with raw apache logs.

awk '{A[$1] += $10} END {for (i in A) print i ": " A[i]/1024/1024 " Mb"}' access.log | sort -k2 -n

A quick little one-liner to figure out what IP is sucking away your bandwidth.

PHP-FPM ondemand!

0

PHP 5.3.9 came out on Jan 10th and reading over the changelog I geeked out.

http://php.net/ChangeLog-5.php#5.3.9

Specifically because of this line item:

Implemented FR #52569 (Add the “ondemand” process-manager to allow zero children).

Go check out that bug and the related patch. It’s going to be amazing to see shared hosting services take advantage of PHP-FPM with the ondemand process manager option. In the past, when you started PHP w/FPM, you had two options dynamic or static, both of which created a pool of php processes at startup. Using ondemand allows for the php children processes to get started when there is a request that needs to be handled.

I just switched my server over to a custom php install using this feature, here was my memory usage before enabling it:

free -m
             total       used       free     shared    buffers     cached
Mem:          1358       1242        115          0          0        342
-/+ buffers/cache:        900        457
Swap:            0          0          0

Immediately after implementation this is my memory usage:

free -m
             total       used       free     shared    buffers     cached
Mem:          1708        518       1189          0          0        491
-/+ buffers/cache:         26       1681
Swap:            0          0          0

I should note that my memory manager increased the available memory on my machine while it was compiling PHP.

Amazing.

Memory Usage on DreamHost Apache configuration Vs. Nginx Configuration

0

Please note that all I’m trying to point out here is the difference in stable memory usage by these two configurations. It should also be noted that the main cause of these differences is (for most people) going to be how PHP is spawned and handled by the two configurations.

Apache on the DreamHost configuration will (by default) use FastCGI for PHP, this will spawn processes as needed (and end them over time) which can lead to large spikes in memory usage. Predicting memory usage in this setup is difficult, to say the least.

Memory Usage of DH's Apache Configuration

Nginx on the DreamHost configuration is a bit easier on the eyes which you can see from the graph below. It should be noted that I run several more sites on my Nginx configuration then I do on the Apache configuration and because of this I run a much larger pool of PHP processes which increases the overall memory. If both servers were running the same set of sites with the only difference in configuration and applications being the selection of Nginx instead of Apache, memory usage would be lower and still predictable.

Memory Usage of DH's Nginx Configuration

JJ’s VPS Memory Manager v1.1 – Released

10

Check out the download links on the side bar to the right. You’ll now see that v1.1 of my memory manager has been released. Since I’ve got to start my shift soon I’m just going to give a quick summary of the new features, starting with the most important:

1) Process list dumped to log on resize (date, used memory, suggested memory, and cache memory are all listed as well)
2) Ability to send email on resize request
3) Ability to tweet (uses oauth) on resize request

Check out the readme file for information on installation, upgrades, and configuration.

As always please don’t hesitate to contact me if you need help or have any questions!

Memory Manager v1.1 is Coming Soon

0

First off, thanks to everyone who has been actively testing and using this application and contacting me with feature requests and questions. The latest version of the memory manager (v1.1) will be coming out soon and with it will come, what I consider to be, an essential feature. With every resize there will be a dump of all running processes sorted by memory usage.

What does that mean to you?

Chances are you’re using this memory manager to help figure out where your memory is going and keep your services up and running. Having a snapshot of your processes, taken when the script sees the need for a resize, will tell you where your memory is actually being used. Very soon you’ll be able to review your logs and click on the “process log” link. I’ll be posting an update to the news you see within the memory manager when the newest version is ready.

JJ’s VPS Memory Manager v1.0 Release

0

I am very pleased to announce that today version 1.0 of JJ’s VPS Memory Manager has now been released. This version is considered stable and all reported bugs have been corrected. Go ahead and download version 1.0 (zip or tar.gz are available) and give it a try, if you run into any problems or have questions shoot me an email: jj@gimmesoda.com

More screenshots after the jump:

(more…)

JJ’s Memory Manager – Update Coming Soon

0

I’ve said this many times before, “I’m not a UI designer.” It’s true, I’ve got a 0 on the scale of design sense. However, I’m extremely thankful to say that there are many people out there who do, and I’m fortunate enough to have some great people around who are willing to help improve my projects. Due to wonderful people donating their time and efforts my memory manager is going to be getting a facelift (I’m really excited about this) and here’s a sample of what’s to come.

Is this not awesome?

Stay tuned, I’m hoping to get this pushed out as soon as the design is implemented on the remaining pages, which may take some time but should be out within the coming week.

JJ’s VPS Memory Manager – Initial Public Release

8

You can grab a copy of the current master branch of my memory manager from here:

https://github.com/jgalvez/JJs-DH-VPS-Memory-Manager/zipball/master

The design to the UI will be getting upgraded when I get the chance to work it out, but the entire application is functional, if you have questions or run into any problems please let me know. Here is the readme so you can see how it is installed and configured:

IMPORTANT NOTE: While I work for DreamHost this application is NOT supported by DreamHost and any questions should be coming to me NOT DH Support!

This application was built to be a VPS Memory Manager focused on uptime rather then cost savings. You can see one of my initial post on the subject here: http://www.gimmesoda.com/thoughts-on-vps-memory-management/

Installation

  1. Grab the files using git or download them from github: https://github.com/jgalvez/JJs-DH-VPS-Memory-Manager
  2. Upload the files.
  3. Create an API key for use with the memory manager from here: https://panel.dreamhost.com/index.cgi?tree=home.api&

The key must have access to the following two functions:

dreamhost_ps-set_size services-progress

  1. Visit the URL you uploaded the memory manager, the install script will start.
  2. Fill out the form that comes up, save the settings.

Configuration

Once installed you should fine tune the application configuration. Let’s look at the important values in the config.php file:

define(‘MIN_MEMORY’, ’300′);
define(‘MAX_MEMORY’, ’4000′);

MIN_MEMORY should be the minimum memory your VPS uses. 300 is default only because that is the lowest amount of memory you are allowed to use, change this to something more realistic.

MAX_MEMORY should be a maximum amount of memory you are willing to pay for, remember that the memory manager will only resize to this level if the memory is actually needed. You are not likely to be at this level of memory usage for long periods of time, if you are go buy a dedicated instead.

Restart the Daemon

Anytime you make a change to the configuration file you should restart the daemon (using the restart link within the application).
That’s it! Feel free to contact me at jj@gimmesoda.com with any questions.

Configure Cron using PHP

1

Once again my insomnia proved to be useful. Have you ever wanted to automate the addition of a cron from PHP instead of having to manually configure from your host’s control panel? Check out the class I created for use with my memory manager:

http://code.gimmesoda.com/memorymanager/libs/Linux_Cron/cron.class.php

In my case I implemented the class by doing the following:


$this->start_daemon_command = '/usr/local/php5/bin/php ' . $system_path . '/daemon.php >> ' . $this->error_file . ' 2>&1 &';
$this->cron_command = '*/5 * * * * ' . $this->start_daemon_command;


function add_cron() {
$crontab = new Gimme_Cron;
$crontab->add_line($this->cron_command);
}


function remove_cron() {
$crontab = new Gimme_Cron;
$crontab->remove_line($this->cron_command);
}

Enjoy!

Go to Top