Migrating a Java Web App to Scala
I have a fairly large data/user-driven web application written in Java (using a lot of the Spring Framework). You can see this site on http://cfreference.net. Today, I'm planning on migrating this to Scala.
A Java CMS - Outline
I'm a Java developer (actually, I like to think of myself more of a back-end services developer who also does web stuff). I've been using Drupal for over a year now. Drupal is written in PHP. In my more snobby moments, I like to make fun of PHP, but really, it's the right tool for many jobs out there. It's the right tool for Drupal. But, there are some basic things that really bug me about Drupal (and most CMS's out there, I would presume). Here's a short list:
* Lack of referential integrity in the database (stop using MyISAM and use InnoDB with foreign keys)
nginx, php, memcached, apc, on Ubuntu
Here are some rough notes on getting this set up. This is by no means complete, but it's a decent starting point.
#!/bin/bash apt-get install bison flex gcc patch autoconf subversion locate apt-get install libxml2-dev libbz2-dev libpcre3-dev libssl-dev zlib1g-dev libmcrypt-dev libmhash-dev libmhash2 libcurl4-openssl-dev libpq-dev libpq5 libsyck0-dev apt-get install libpng-dev apt-get install libmysqlclient15-dev apt-get install libpcre3-dev apt-get install libevent-dev apt-get install libjpeg62-dev cd /usr/local/src
Apache HTTPClient 3.0.1 Speed vs Default Sun Implementation
Funny story. I am testing the performance of Apache XML RPC Java client (v3.1.2) using Apache HttpClient 3.0.1 (and the MultiThreadedHttpConnectionManager) vs the default Sun implementation. I was running 32 simultaneous threads. The defalt implementaiton would take less than a second. Apache HttpClient would take about 30 seconds. I could not figure out why this was. Then I looked a my logs and noticed that HttpClient spit out a bunch of logs. So I changed the logging level from DEBUG to INFO and wha-la, HttpClient performance was now better (not by much) than the default implementation.
Connecting to Drupal 6.10 Using Java snd Services
I have a Drupal 6.10 site and a home-grown Java webapp. They need to talk to eachother. Getting Drupal to talk to Java is pretty easy as I can build whatever interface I want into the Java webapp. Going the other way (Java to Drupal) is what I will discuss in this article.
First, you have to have Services enabled on your Drupal installation. I'm also using an API key (you have to configure this in Drupal).
Here's the Java code I used to connect:
import org.apache.xmlrpc.client.*; import org.apache.commons.codec.digest.DigestUtils;
Load Testing With EC2 and JMeter
I need to load test a website. I want to really stress it, i.e. testing it from my desktop just won't cut it. So I've decided to load test it using servers in the EC2 cloud. This is a great option because
- it can scale very well (I can requisition as many hosts as I like)
- I can see how the site is performing under load from my desktop easily (my network is not clogged with traffic)
I'm going to use JMeter for the load testing.
My plan is to do the following: