Zend Framework Application Runtime Benchmarking - performance

Been trying to understand the overall performance of our application by comparing the benchmark we get from our dev environment and our prod environment.
Interestingly, in our dev environment, which is our local machine, we get application run time as fast as 98ms.
The same application runs on avg at 400ms in our production server, which is a VPS with CentOS 5.8 running.
I'm assuming that this increase must be because of network connection lag between web server and database server, since we didn't have this gap in the dev environment, everything is local.
We're using Doctrine 2.0 as an ORM for our application, we haven't really gotten into optimizing it by caching.
Is there a way to optimize this lag time? Or am I completely wrong about the case?

Your best bet to measure actual database and query time used is to setup a database profiler.
You can read this: Profiling Doctrine 2 with Zend Framework
Just as a note, running a profiler should only be done for testing. You shouldn't run it all the time, especially if your production server is high volume. It will add some processing time, but it will give you more information about your queries and connection time.
Your assumption of it being latency between the boxes could be true and this will verify it for you.

Related

classic asp site run very slow on IIS server 10

I am working on a classic asp project. I have deployed it on the window 10 IIS Server (version 10.0.17134.1) on my local computer it's running fine but when I deployed it on my test server which IIS Server (version 10.0.19041.1).it becomes very slow. I have tried some solutions to fix it like to increases the maximum worker processes.it was still slow.
when I disable RealtimeProtection from the window firewall it becomes fast . How can I increase its performance without disabling RealtimeProtection from the window firewall
If the database is an Access database, convert to MS-SQL as Access can cause such slowness on recent versions of Windows IIS. Access is not recommended today anyway because it has security issues.
If you are using MS-SQL with JOINED tables find another way because despite what some say, JOINED tables can be a resource killer. Run an initial query and then run a separate query based on the first results... very much quicker in most circumstances.

Performance testing environment

How do you begin with setting a Load environment for an Enterprise application (traditional MVC application with connectivity to some dependent enterprise systems)? For example, it would be ideal to have similar amount of Servers with same configuration as Production environment, also the Database should have similar size and capacity as Production to make Load environment similar to Production.
This does not happen in many organization, and I have seen organization using a trimmed down version of Production infra for the Load testing. Does that seems to be correct approach? Can we run a load test on the trimmed down version of Prod infra? Will this approach produce the result that can be used to predict Production application performance?
If you need to measure how many users / requests per second your application can support the only way of doing it is running your test against production or production-like environment.
There are some things you could check against a scaled-down environment, for example:
Running a soak test, this way you can discover memory leaks
Running a load test having profiler tools telemetry enabled on the application under test side, this way you will identify the slowest functions, largest objects, etc.
Running a database load test, this way you can find out slow queries subject to optimization
More information: Performance Testing in a Scaled Down Environment. Part Two: 5 Things You Can Test

Is there a way to simulate round trip time from spring to a postgres database on localhost?

Im using Spring and a postgres database. Is there a way to simulate(create) a roundtrip time between spring and the postgres database running on localhost? That way i could create an environment similar to my production environment which would help me seeing potential performane issues earlier. For example, i have the same amount of data on localhost as i have on prod. A new feature was working perfectly(no performance issues) on localhost. Then i released it and it turned out to be really slow on production. The reason for that - as i figured out later - was that there were a lot of SQL requests happening in the background. Because the roundtrip time on prod from my spring backend to the database is way larger than the one on localhost, the performance problem only occured on prod. If i had that simulated roundtrip time on localhost i would be able to see that problem before releasing it on prod.
You probably want to emulate this on the kernel level. On Linux:
sudo tc qdisc add dev lo root netem delay 50ms
This injects latency on the loopback device (localhost or 127.0.0.1)
Javamelody is an awesome free open source tool that can be very easily integrated in Spring based application. It can provide you number of application/host stats in beautiful charts with extremely low overhead. It can capture time and number of each SQL, Spring services, http requests etc. You can use it in development environment to fix any performance issues. You can play around with online demo here. I have used it extensively and it's very useful.

IIS maximum worker processes

I've been researching this quite a bit and just wanted some professional opinions on this. I am working on an eCommerce site that is really slow for submitting orders. Would creating a web farm be beneficial? If not, what would - server, or network wise (load balancers, etc...)?
Assume the app is optimized as much as can be for now and we need to look at other alternatives.
Environment:
Windows 8 RC 2
IIS 7.5
SQL Server 2008
Ideas
IIS and database on separate server
Load balancers
Maybe we can find a cheaper solution.
If it is only the submit process which is slow perhaps you can just improve the code and use some background workers that won't block the main thread.
Otherwise what about just upgrading your server?
Static file compression.
Create separate application pools for static and dynamic pages with in the website.
Get the heavy feature onto a separate app pool. Check if that helps.
Do optimization on SQL server end. Indexing?
Other than this I would look in to the code. IIS performance is highly dependent upon the pages being executed.
You may also want to check from browser developers tool as to which part of the request is actually clocking the most amount of time. That will give you a better idea of which aspect of performance you should really be concerned about.

Software for performance tests on an http server

I have developped a HTTP web service which is queried by smartphone. I want to test the performances of all this service containing :
A java server (java 6, java + play framework)
A database (Mysql 5.1.41)
A Linux (ubuntu) server (kernell 2.6.32)
I have tried leading test campaigns using python scripts with many threads or sequential tests. But it's hard to have conclusions...
I want to be able to have the maximum number of request per second for my service, the average time for each request... complete dashboards displaying a lot of information
I can do many scripts to test that but I am shure that well-known softwares permits to conduct these tests. Ideally these softwares could also display information about where I loose time ...
Do you have hints ?
Thanks for your help
Some tools I've used for HTTP benchmarking
Apache Bench
Siege
JMeter
Of these, JMeter is probably best for the situation you describe. All of these display a lot of information, but won't explain where you lose time.
For that, I'd suggest a profiler such as JVisualVM (comes with the JDK) or YourKit. From a profile you can observe where you spend the most time and focus on optimizing that.

Resources