I’ve moved my server to Tilaa
by solomon on Jan.26, 2012, under Dear diary, Tech
I’ve been using SliceHost, a virtual private server, for a year. It was great first, cheaper and efficient. But after RackSpace bought them, the quality decreased a lot, and I guess they changed many things and it effect my product. I didn’t have time to deal with them, all I need is a server there where I pay each month and focus on my projects, not the server’s problems.
The other problem with it that it become REALLY slow. The datahouse is in US and I locate in Istanbul. And Turkey’s internet providers suck.
So I decided to go for a Europian company. In fact, my 1st consideration was an american company, Linode, who has very good critics and considerable price range. But still, after slicehost experience, I didn’t want to go for a similar company.
Then I found Tilaa who has good options for VPS. They’re Netherlands based company and their datahouse locates in there. They aren’t a big company but I guess they have good approach.
So far I don’t have serious problems with them. The 1st thing that I noticed that they billed me 12.26 euros rather than 9.95, soon after I send an email about it, I find out that they charge you from a particular day of the month to another. I subscribed on 23th of January, They’ve charged me from 23th to 25th of January and 25th jan to 25th feb, which is fine for me. I only think that their explanations in their website is lacking, if they improve it they become better.
And hopefully the website you’re seeing now is fast enough because it’s already on Tilaa.
Zend Framework 2 Sample Application
by solomon on Jan.24, 2012, under Uncategorized
I am planning to use ZF2 on my future projects and porting my ZF1 library to it. Just to see how it’s like, I created a sample project. Hope that it helps someone who try to do it as well.
https://github.com/laplacesdemon/ZendFramework2-Sample-Application
Zend Framework 2 comparison
by solomon on Jan.19, 2012, under php, Uncategorized
I’ve been using Zend Framework 1.x for quite a long time. It is a stable framework with a lot of features. But I always have some performance issues in terms of memory/cpu usage and page load time. I have looked at the new version of Zend Framework which is under active development. As my first impressions, I have astonished by their new design. Removing require_once statements, using namespaces and lazy loading of components should boost the performance drastically. In addition, the new module system will be very flexible especially for 3rd party component developers.
To see it in action, I have decided to do a quick benchmark. I have used the zf2 skeleton application, and my current zend framework 1.11 setting which I use in any of my PHP projects. The comparison is totally subjective and the aim is to have an overall impression.
I have used the apache benchmarking tool. The number of requests are 100 and the concurrency level is 5.
ab -c 5 -n 100 http://myUrl
Here are the results
Zend Framework 2
Server Software: Apache/2.2.20
Server Hostname: localhost
Server Port: 80
Document Path: /zf2-sample/public
Document Length: 351 bytes
Concurrency Level: 5
Time taken for tests: 0.214 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Non-2xx responses: 100
Total transferred: 61900 bytes
HTML transferred: 35100 bytes
Requests per second: 466.58 [#/sec] (mean)
Time per request: 10.716 [ms] (mean)
Time per request: 2.143 [ms] (mean, across all concurrent requests)
Transfer rate: 282.04 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 10 6.3 11 33
Processing: 0 1 2.6 0 15
Waiting: 0 0 2.6 0 15
Total: 1 11 6.1 11 33
Percentage of the requests served within a certain time (ms)
50% 11
66% 12
75% 13
80% 14
90% 16
95% 23
98% 32
99% 33
100% 33 (longest request)
Zend Framework 1.11
Server Software: Apache/2.2.20
Server Hostname: localhost
Server Port: 80
Document Path: /ad
Document Length: 336 bytes
Concurrency Level: 5
Time taken for tests: 0.410 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Non-2xx responses: 100
Total transferred: 58900 bytes
HTML transferred: 33600 bytes
Requests per second: 243.98 [#/sec] (mean)
Time per request: 20.494 [ms] (mean)
Time per request: 4.099 [ms] (mean, across all concurrent requests)
Transfer rate: 140.33 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 20 14.7 16 53
Processing: 0 1 3.6 0 28
Waiting: 0 1 3.5 0 28
Total: 1 20 14.4 17 53
Percentage of the requests served within a certain time (ms)
50% 17
66% 29
75% 33
80% 34
90% 40
95% 46
98% 51
99% 53
100% 53 (longest request)
Conclusion: New version of Zend Framework is nearly double times faster that the current version.
How to remove require_once statements in Zend Framework on Mac
by solomon on Jan.13, 2012, under Uncategorized
Since autoload does the work, no need to keep the backward compatibility mode of Z
Stupid windows drives me crazy
by solomon on Jan.10, 2012, under Uncategorized
My father has just called me and complained that he couldn’t connect to the wireless network at home. Since I’ve solved the problem before, I started to explain. The wireless network name in my house and theirs is the same, but obviously passwords are different, and windows isn’t clever enough to ask it again when changing the location. I don’t mind windows has some bugs but this should not be a big deal.
At the end, I’ve spend like 30 mins on the phone trying to figure out windows menus (I don’t have windows, so I need to stick with him). While I was talking with him I’ve researched about the problem and saw that there is actually a screen called “Manage wireless networks”. I directed him to that menu but apparently it wasn’t there. Then he searched for the menu, nope, won’t help. Then he somehow found the
Don’t buy from slicehost if you’re in Turkey
by solomon on Jan.10, 2012, under Uncategorized
Basically it is cheap’n shitty. this blog is served on a server on their system. As you see it is bloody slow. I even struggle to write this post and there is always a possibilty to request timeout while posting it, thankfully wordpress saves the posts as drafts so I loose no data.
I am looking for a new server
I recovered this post from my drafts, dammit, I can’t even submit my posts.
My personal website is online
by solomon on Jan.05, 2012, under Dear diary
Finally my personal website is online. here is the link
Unit Testing Asynchronous Operations with OCTest
by solomon on Sep.21, 2011, under Programming
I have experienced problems while I write the unit tests for a RESTLike web service client. The client class is basically a wrapper around NSURLConnection which asynchronously fetch/download data from a server. Unit tests are synchronously operations and will not work in this context.
The test case is the following: connect to a server via its URL and fetches some data from it. I have used a loop while the downloading operation continues to force the test method to wait for the connection class to finish its job. Following is the test case method:
- (void)testConnection {
// the custom strategy class to encapsulate the behavior of the rest client
WSRestClientDefaultStrategy* strategy = [[WSRestClientDefaultStrategy alloc] init];
// create the rest client under testing
WSRestClient* client = [WSRestClient restClientWithStrategy:strategy withMethodName:@"anymethod" andParams:nil andHttpMethod:@"GET"];
[client execute];
[strategy release];
// this is a workaround in order to test async requests
NSRunLoop* runLoop = [NSRunLoop currentRunLoop];
// wait while the connection class does its job
while ([client loading] && [runLoop runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]);
}
Please note that the unit test normally should not fetch any data from any external service. Please consider to use mock classes to reduce the dependency. You can use a framework like OSMock for creating the mock classes
a netbeans bug on jax-rpc
by solomon on Apr.19, 2011, under Programming
I have tried to write a rpc web service client in java using a wsdl file on netbeans, but a ittle bug drives me crazy. If you come across the following error during the compilation, then the following solution might save your time.
taskdef class com.sun.xml.rpc.tools.ant.Wscompile cannot be found
open up /nbproject/project.properties
Change:
wscompile.classpath=${wscompile.tools.classpath}:${j2ee.platform.wscompile.classpath}
To:
wscompile.classpath=${wscompile.tools.classpath}:${j2ee.platform.wscompile.classpath}:${javac.classpath}
woila
