Last week I setup a server in a cloud based on Xen virtualization technology. After some hours research I decided to go for the Rackspace cloud. I chose the minimal setup to start with, which is a 256MB memory configuration that comes with 10GB disk space. As stated in the specs, the 256MB plan will get you 1/64 of the CPU allocation. Which is fine to start with for a standard LAMP setup.
For now they only offer a large variety of Linux distributions. I chose Debian 5.0 Lenny, because it makes migration easier as the site is running on Debian 5.0 already. The registration process and setup of the minimal Debian install went very smoothly. In under two hours I had successfully migrated a website. So for the setup part I am totally satisfied, let’s see how the availability part will develop.
In order to know what kind of resources a new application needed I figured out to do a load test. The load testing software I used for this test is Apache Jmeter. The application to test is a Java based application deployed in Tomcat 6.
I used the Jmeter HTTP Proxy Recorder to simulate a normal user session to create a realistic test plan. Once I executed the test plan against the web application it returned Internal Server Error (Response code: 500). By using the “View Results Tree” Listener I was able to locate the problem as the Listener displays basic HTML and XML representations of the response.
javax.faces.application.ViewExpiredException: viewId:/presentation/task.jsf - View /presentation/task.jsf could not be restored.
It appeared that the HTTP Proxy Recorder had recorded the server and client state. The javax.faces.ViewState field is written for both server and client side state saving. So removing this attribute from the sampler data makes Jmeter process the pages without error.
It took me a couple of hours to resolve this issue, hope this helps someone stumbling across the same.
Today I switched from the Code Markup to the Code Snippet WordPress plugin. Therefore I had to change the way the code block is activated. This is a time consuming job if you have to do this by hand, so I figured out there should be a smarter way of doing this. Check out the MySQL replace function below:
update [table_name] set [field_name] = replace([field_name],’[string_to_find]‘,’[string_to_replace]‘);
And so the above translated to the lines I needed:
mysql> update wp_vleeuwen_posts set post_content = replace(post_content, ‘<pre><code>’, ‘[code lang="text"]‘);
Query OK, 35 rows affected (0.06 sec)
Rows matched: 72 Changed: 35 Warnings: 0
mysql> update wp_vleeuwen_posts set post_content = replace(post_content, ‘</code></pre>’, ‘[/ code]‘);
Query OK, 35 rows affected (0.01 sec)
Rows matched: 72 Changed: 35 Warnings: 0
mysql>
Notice the little typo I had to make in order to let the above code snippet work ([/ code]).