servercheck – keep processes running

November 8, 2010 No comments »

Its a process/server babysitter that will manage, monitor and restart processes as needed to keep things running. Alerting has been configured to not be too annoying, else the logging will enough information to go back later and retrace steps.

I use this on my cpanel server – processes die and need restart occasionally, but I have been using a variation of this for 3 years now. Some wheels were re-invented along the way – but I am learning OO perl and this is something I’ve meant to re-write since 2007 properly.. This is much closer to what I envisioned.

download servercheck

Install steps: all done in the config file – see INSTALL in zip file
0. Configure what processes to run
1. How/when to check, stop/start/restart and frequency
2. When NOT to check – like NOT restart apache when yum is running
3. How often to send email/text via email alerts..

Use perldoc or servercheck.pl -h to see the help for the modules. See INSTALL and README for info..

This was tested on cpanel and direct admin servers – will work with any *nix that has perl installed and with tweaking of course.

Expect about 1/2 hour to configure the first machine. A cpanel and direct admin were
different enough it took 20 minutes to configure the direct admin machine…

  • del.icio.us
  • Digg
  • Slashdot
  • Technorati
  • MisterWong
  • Reddit

Search craigslist with regex

October 30, 2010 No comments »

Earlier this week was looking (again) on craigslist to see whats available for a Mercedes S320 –
(I have been amazed at these cars since saw one in 1992 – now they are 11-19 years old, can be
picked up for a reasonable price… Now maintaining one – see the Benzworld W140 forum.. Thus I’ll be an admirer at this time..

Anyhow – I know CL runs cgi (Perl??) and wondered how the search will react to a regex – much to
some delight, quite well.. Alternation – choices – wrapped in (), delineated by | (above the \ key on US keyboards)

Example: 2010 World Series winners are (Giants|Rangers)!
So, lets look for a classic W140 S Class Mercedes…
Put into the search bar: mercedes+(s500|s420|s320)+(1995|1997|1999)

Search craiglist with regex!

  • del.icio.us
  • Digg
  • Slashdot
  • Technorati
  • MisterWong
  • Reddit

Protected: E320 Mercedes

July 8, 2010 No comments »

This post is password protected. To view it please enter your password below:


  • del.icio.us
  • Digg
  • Slashdot
  • Technorati
  • MisterWong
  • Reddit

WP SuperCache Rocks

April 16, 2010 No comments »

I installed about a year ago and was curious to see how welll it really works…

Baseline – hammer with 1000 hits, concurrency = 10. Uptime (load1) remained around 0.6 over the duration of the test:

$ ab -n 1000 -c 10 http://mochabomb.com/blog/drop-bogon-ips-daily/
This is ApacheBench, Version 2.3 < $Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking mochabomb.com (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests

Server Software:        Apache/2.2.14
Server Hostname:        mochabomb.com
Server Port:            80

Document Path:          /blog/drop-bogon-ips-daily/
Document Length:        30815 bytes

Concurrency Level:      10
Time taken for tests:   102.070 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      31256335 bytes
HTML transferred:       30840920 bytes
Requests per second:    9.80 [#/sec] (mean)
Time per request:       1020.695 [ms] (mean)
Time per request:       102.070 [ms] (mean, across all concurrent requests)
Transfer rate:          299.05 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       82  190 411.0    132    3193
Processing:   427  827 214.1    776    2113
Waiting:       90  149  48.9    144     823
Total:        521 1017 468.5    914    4555

Percentage of the requests served within a certain time (ms)
  50%    914
  66%    958
  75%   1008
  80%   1061
  90%   1265
  95%   1504
  98%   2307
  99%   3921
 100%   4555 (longest request)

Disabled wp-supercache, emptied cache and retested – used only 200 to start with – uptime (load1) was around 9.0!

$ ab -n 200 -c 10 http://mochabomb.com/blog/drop-bogon-ips-daily/
This is ApacheBench, Version 2.3 < $Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking mochabomb.com (be patient)
Completed 100 requests
Completed 200 requests
Finished 200 requests

Server Software:        Apache/2.2.14
Server Hostname:        mochabomb.com
Server Port:            80

Document Path:          /blog/drop-bogon-ips-daily/
Document Length:        30616 bytes

Concurrency Level:      10
Time taken for tests:   133.357 seconds
Complete requests:      200
Failed requests:        197
   (Connect: 0, Receive: 0, Length: 197, Exceptions: 0)
Write errors:           0
Total transferred:      6172753 bytes
HTML transferred:       6116953 bytes
Requests per second:    1.50 [#/sec] (mean)
Time per request:       6667.857 [ms] (mean)
Time per request:       666.786 [ms] (mean, across all concurrent requests)
Transfer rate:          45.20 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       81   85   3.6     83     104
Processing:  3004 6464 1752.2   6397   11600
Waiting:     1709 4047 1194.1   3895    7517
Total:       3086 6549 1752.5   6480   11682

Percentage of the requests served within a certain time (ms)
  50%   6480
  66%   7234
  75%   7845
  80%   8099
  90%   8978
  95%   9656
  98%  10404
  99%  10592
 100%  11682 (longest request)

enabled cache, test one more time. Inititally php processes were high – then after about 10 seconds tapered off and http was the dominant one, though at 0.6 again for load1

$ ab -n 200 -c 10 http://mochabomb.com/blog/drop-bogon-ips-daily/
This is ApacheBench, Version 2.3 < $Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking mochabomb.com (be patient)
Completed 100 requests
Completed 200 requests
Finished 200 requests

Server Software:        Apache/2.2.14
Server Hostname:        mochabomb.com
Server Port:            80

Document Path:          /blog/drop-bogon-ips-daily/
Document Length:        30772 bytes

Concurrency Level:      10
Time taken for tests:   26.576 seconds
Complete requests:      200
Failed requests:        199
   (Connect: 0, Receive: 0, Length: 199, Exceptions: 0)
Write errors:           0
Total transferred:      6289923 bytes
HTML transferred:       6207305 bytes
Requests per second:    7.53 [#/sec] (mean)
Time per request:       1328.780 [ms] (mean)
Time per request:       132.878 [ms] (mean, across all concurrent requests)
Transfer rate:          231.13 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       82  179 370.2    132    3182
Processing:   438 1106 1327.1    755    7769
Waiting:       92  465 1361.8    156    7341
Total:        522 1285 1359.2    902    7866

Percentage of the requests served within a certain time (ms)
  50%    902
  66%    993
  75%   1127
  80%   1293
  90%   1635
  95%   5460
  98%   7563
  99%   7810
 100%   7866 (longest request)
  • del.icio.us
  • Digg
  • Slashdot
  • Technorati
  • MisterWong
  • Reddit

Parallels Bug – root login reset when change hostname

June 15, 2009 No comments »

Sent this to Parallels yesterday – hope they fix it..

==================================

Hi,

This weekend after 5 months accessed the Parallels control panel and “corrected” my server from the initial hostname, and did other maint and stumbled onto a bug, well what seems to me a bug.
It can be replicated like this:
For purposes of this say root was originally “root#ABC” and the new one is “root#DEF”
1. At the command line of the VPS, change root to something else, in this case change from root#ABC to root#DEF

2. In the Parallels automation change the hostname of the VPS.

3. The root password will now be set back to the old one.

I’d like to have been warned instead of wondering for a few hours why my server root password changed. Glad to know why – and that it was not rooted.

  • del.icio.us
  • Digg
  • Slashdot
  • Technorati
  • MisterWong
  • Reddit

Mochabomb is Digg proof thanks to caching by WP Super Cache