Archive for the 'Chat' Category

HTTPERF is your friend

December 13th, 2009 by pyrat


flickr

Performance tools are a great help for testing your web application deployment setup. They not only let you judge how the performance of the application is but also catch errors. Nobody wants a web application which starts to spit out errors when put under load or worse, randomly!

HTTPERF is a gift from HP which is my favourite tool at the moment.

An example httperf usage is:

  httperf --num-conns=800 --rate=80 --timeout=5 --server=google.com --port=80 --uri=/

This hits the google homepage with 80 requests per second for 800 requests in total. This test will run for circa 10 seconds.

Results are as follows:

Total: connections 800 requests 800 replies 800 test-duration 10.252 s

Connection rate: 78.0 conn/s (12.8 ms/conn, <=25 concurrent connections)
Connection time [ms]: min 140.1 avg 237.1 max 771.7 median 240.5 stddev 40.5
Connection time [ms]: connect 111.2
Connection length [replies/conn]: 1.000

Request rate: 78.0 req/s (12.8 ms/req)
Request size [B]: 63.0

Reply rate [replies/s]: min 76.2 avg 77.9 max 79.6 stddev 2.4 (2 samples)
Reply time [ms]: response 125.9 transfer 0.0
Reply size [B]: header 280.0 content 219.0 footer 0.0 (total 499.0)
Reply status: 1xx=0 2xx=0 3xx=800 4xx=0 5xx=0

CPU time [s]: user 0.51 system 9.64 (user 5.0% system 94.1% total 99.0%)
Net I/O: 42.8 KB/s (0.4*10^6 bps)

Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0
Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0

This line below is important:

Reply rate [replies/s]: min 76.2 avg 77.9 max 79.6 stddev 2.4 (2 samples)

It tells us that the avg requests per second is 77.9. There is a low standard deviation, which is good. If you have a high stddev you should be worried. Lastly, it has calculated this using 2 samples. You can increase the number of samples by increasing the num-conns, which will give you a more reliable dataset.

Watch out for the errors:

Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0
Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0

Looking good, google is performing well on the error front. Obviously google.com handles more than 80 req/s! Now go away and performance test some of your sites!

There is some valuable further watching to be had. Episodes 15 and 16 mention httperf.

5 programming languages to learn

October 12th, 2009 by pyrat

I am going to improve my knowledge / learn afresh the following 5 languages in the next few months.

  • javascript
  • curl
  • c
  • erlang
  • c#

Javascript is used more and more nowadays, with powerful frameworks such as jquery and prototype and improved browser support. Internet users expect a rich internet experience nowadays and often this is made possible by a sprinkling of javascript. Whilst I have a fairly strong javascript knowledge, I would not consider myself to be accomplished. I will try and write a useful jquery plugin to further my knowledge.

Curl is a command line tool for transferring files with URL syntax, supporting FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS and FILE. curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, user+password authentication (Basic, Digest, NTLM, Negotiate, kerberos…), file transfer resume, proxy tunneling and a busload of other useful tricks. Command-line network tools interest me (wget is ace) so I want to learn curl as I don’t currently use it at all.

c is a low level compiled programming language. I used it for graphics programming at university but haven’t touched it since. I want to refesh my memory, maybe I will try writing a some c code which interfaces with a ruby script or something along these lines.

erlang is a general-purpose concurrent programming language and runtime system. The sequential subset of Erlang is a functional language, with strict evaluation, single assignment, and dynamic typing. For concurrency it follows the Actor model. It was designed by Ericsson to support distributed, fault-tolerant, soft-real-time, non-stop applications. The first version was developed by Joe Armstrong in 1986. It supports hot swapping so code can be changed without stopping a system. Erlang was originally a proprietary language within Ericsson, but was released as open source in 1998. (wikipedia)
Concurrency is deemed to become more important in the future, due to the current trend in processor design. Hence, I am interested to both write some concurrent code but also bend my mind around functional programming once and for all.

c# is deemed the java killer for the “I have a good job with a big company crew.”. I know an increasing number of developers that work in the .net platform. Rather than be ignorant and shout about how good the ruby platform is, I need to sample the delights of .net and specifically c# for myself. I will not however, call Scott Hanselman god.

Will keep you all updated on how I fare in these language related adventures.

Halvard happy with chanterels

September 11th, 2009 by pyrat

Halvard found about 3kg of chanterels in storlidalen.

Buying in Bulk. Im a fan.

June 12th, 2009 by pyrat

Buying in Bulk

Dont you hate running out of stuff?

  • Sitting on the toilet, dropping the kids off at the pool; the penny drops. No toilet paper!
  • Wake up starving, put your favourite cereal (cheerios) in a bowl. No milk!
  • Excited about another breakfast of champions, doh!

Im fed up of running out of things so have been developing a healthy? obsession with buying stuff in bulk. Its a good feeling when you know that you have enough supplies to eat beans on toast for another 10 days straight.

Nopesport – A case study

November 9th, 2008 by pyrat

I recently redeveloped the orienteering news website nopesport This was done with the artistic touch of nonimage as it was back in 2003 when nopesport was an “overnight” success having been cooked up when both nonimage an I were out of work after university.

I have been working professionally as a web programmer of 4-5 years now, and not enough of this expertise had been used in the previous php based incarnation.

Workflow

A big part of developing a web application remotely is workflow. There are various tools that help oil the wheels in a distributed team.

  • Project Management

You need to be able to discuss and document the situation with project management software. We used basecamp for this.

  • Source Control

Gitrdone

After graduating from svn school, like most rails heads I have moved to the distributed version control system git. Android is now using git as well along with a few other high profile projects. Its the best thing that I have learnt in 2008 re technology.

  • Simple “One-click” Deployment

Capistrano and source control allow super slick deployments. After you have set it up, bring on the automation.

  • Designer integration with source control

Having a designer that can code CSS, is a major asset. Having a designer that can code CSS and be integrated into the development workflow is a super special major asset.

  • Bug documentation and fixing process

Having a standard way for bug reporting, and a slick fast process of fixing them is top class.

Design

I dont speak for nonimage here.. maybe he will do a guest post on the subject!! hint hint

We are sick to the stomach with shiny web 2.0 designs. They are out of date in my book and it is sad the number of designers who are still just graduating from the web 1.0 style of designing only to find themselves still behind after they update their skills.

We decided that typography was important (like a lot of designers and developers 2007-2008) and we wanted a dirty grunge design.

We had some conversations with the other guys who run the site day to day and do a sterling job. They added their input along the way. Generally though, we were essentially our own client which is a great situation to be in.

XDA Mini S Reset – Format Everything

November 8th, 2008 by pyrat

Press the soft reset button. (Under the IR port) As you let go of that reset button, make sure you are pressing both the comm manager button, AND the voice buttons. Thats the top left side and upper right side buttons. This is called a hard reset and WILL ERASE EVERYTHING prom the phones memory. Do the screen calibration and cut/paste bit. When it say’s “Tap the screen to start using your device”, be ready to press the soft reset again. This is because when you tap the screen, a customisation box will appear. PRESS THE RESET BUTTON, when you see this box. The phone reboots and hey presto, proper PDA, not o2’s idea of one. Hope this helps.

Technical tip.

Silly Ropeswing Fun

October 21st, 2008 by pyrat

A funny time playing on a big ropeswing in London. Please ignore my embarrassing yelps.

Updating rubygems memory problem

October 18th, 2008 by pyrat

This is old news, but if like me you are updating an old rubygems installation because it is sucking up memory when you are installing stuff, the following upgrade command will work for you.

  sudo gem update --bulk-threshold 10009 --system

Apache SSL Configuration

October 15th, 2008 by pyrat


Chevrolet Apache

Little example config for SSL on a server running mod_rails (passenger).

  <VirtualHost 222.111.143.223:443>
    ServerName www.website.co.uk
    DocumentRoot /var/www/apps/website/current/public
    RailsEnv production
    SSLEngine On
    SSLCertificateFile /etc/apache2/certs/website.crt
    SSLCertificateKeyFile /etc/apache2/certs/website.key
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
  </VirtualHost>

Who is this man?

October 9th, 2008 by pyrat


Can you tell me who this is?