Category Archives: server monitoring

Monit apache with passphrase enabled SSL


I wanted to montior my apache instance with Monit . Its so simple…

I just had to add the apache related configuration in monitrc file and start monit.

Looked like it worked…BUT…

 

When I looked at example.com:2812. It shows me something like “ ’apache’ process is not running.” I realized that as My server has purchased SSL certificate and for this we have given a passphrase. So When ever apache starts, it asks for the pass phrase for verification. When monit tries to run the apache it also sends the dialog box of asking the passphrase which monit is unable to give. Hence I can not monitor Apache with pass phrase enabled SSL via monit. 

Now when I sit to resolve this issue. I have an easy option : Repurchase the ssl with passphrase as nil. But that is costly and is not safe at all. So I looked for some other solution. And I found one in name of  ’SSLPassPhraseDialog‘.

One just has to add one line in their apache2.conf file :

 
SSLPassPhraseDialog exec:/content/ssl/pp/pp.out

This file should contain something like:

#!/bin/sh
echo 'mypassphrase'

 

and make this file executable by:

chmod +x passphrase_file
Done…Simple na. Now you can just restart your apache and check that its not asking for a passphrase now :)


Monitoring Passenger


I have recently made some changes in my staging server to get 3 times better response. Would like to share the points with everyone so that other don’t have to do so much of googling that I did.

So, I have my staging(256MB) and production server(2GB). On staging when I had MaxPoolSize of 6(default: Max number of threads spawned by passenger). My server gets killed in 10 consecutive requests coz of use of lots of swap. So I had to make it to 2 as passenger doc suggests to make it 2-3 for 256 MB server.

 

But now one more problem arise, that response time for the request after long time(which could be anything > 10mins) was very high around 30s. Which is quite unacceptable. I found the reason being the MaxPoolTime(Max time in which the threads got killed if no request encountered). And once all the threads got killed and then comes a request  it takes whole lot of time to start these:

1. Framework Spawner

2. Application Spawner

3. Then Spawn a new thread

 

The solution to this problem  was not letting one of the thread get killed. I have searched a lot for this but got noway by which this can be implemented. So I have to find a work around. Which was… to set the Application Spawner not getting killed. This can be achieved by setting APP_SPAWNER_MAX_IDLE_TIME to very large(say 999999). 

I have received amazing improved performance by applying this. Would you like to try???


Follow

Get every new post delivered to your Inbox.