DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Load Testing Essentials for High-Traffic Applications
  • A General Overview of TCPCopy Architecture
  • How To Organize End-To-End Quality Assurance and Testing for E-Commerce Apps
  • Five Steps To Building a Tier 1 Service That Is Resilient to Outages

Trending

  • Apache Doris vs Elasticsearch: An In-Depth Comparative Analysis
  • The Modern Data Stack Is Overrated — Here’s What Works
  • Enhancing Security With ZTNA in Hybrid and Multi-Cloud Deployments
  • Understanding and Mitigating IP Spoofing Attacks
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Testing, Tools, and Frameworks
  4. JMeter load testing against Apache Webserver: Errors and Resolutions

JMeter load testing against Apache Webserver: Errors and Resolutions

By 
Mick Knutson user avatar
Mick Knutson
·
Jan. 05, 12 · Interview
Likes (1)
Comment
Save
Tweet
Share
25.6K Views

Join the DZone community and get the full member experience.

Join For Free

have been working on a fairly simple JMeter load script that I can run a series of 4 sequential pages against an Apache server, but the goal was to have the server support 2,000 concurrent requests for 5 minutes without error.

Most of my issues in this exercise have been with JMeter and the client machine used to test the Apache server.

To begin, I must state I was originally configuring Apache with a prefork MPM:

StartServers        100
MinSpareServers      75
MaxSpareServers     100
ServerLimit        2000
MaxClients         2000
MaxRequestsPerChild   0

At approximately line 72 of Jmeter.bat, there are several entries the manage the JVM for running Jmeter.

set HEAP=-Xms512m -Xmx512m
set NEW=-XX:NewSize=128m -XX:MaxNewSize=128m
set SURVIVOR=-XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=50%
set TENURING=-XX:MaxTenuringThreshold=2
set RMIGC=-Dsun.rmi.dgc.client.gcInterval=600000 -Dsun.rmi.dgc.server.gcInterval=600000
set PERM=-XX:PermSize=64m -XX:MaxPermSize=64m

I decided to start with 1,000 concurrent requests for 5 minutes just to see how the test would fair.

With the above settings I started getting OOM errors almost immediately so I decided to increase the HEAP and NEW memory to eliminate the issue and wanted to add more GC settings to increase the JVM’s ability to clean up:

set HEAP=-Xms1024m -Xmx1024m -Xss128k
set NEW=-XX:NewSize=256m -XX:MaxNewSize=256m
set SURVIVOR=-XX:SurvivorRatio=14 -XX:TargetSurvivorRatio=50%
set "TENURING=-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:+DisableExplicitGC -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:MaxTenuringThreshold=4"
set "EVACUATION=-XX:+AggressiveOpts -XX:+UseFastAccessorMethods -XX:+UseCompressedStrings -XX:+OptimizeStringConcat"
set RMIGC=-Dsun.rmi.dgc.client.gcInterval=600000 -Dsun.rmi.dgc.server.gcInterval=600000
set PERM=-XX:PermSize=64m -XX:MaxPermSize=64m

This did resolve the JMeter OOM issues, but now started getting Apache errors. During the ramp-up phase, I started getting connection refused errors:

Response code: Non HTTP response code: org.apache.http.conn.HttpHostConnectException
Response message: Non HTTP response message: Connection to http://pasundtastgprt2:8001 refused

I started looking at the Apache server and noticed that the number of httpd threads was at 1,000 and it appeared that JMeter was running out of memory because the requests where starting to back up.

This is why we load test right!

So I decided to run a worker MQM and recompiled Apache to support the new MPM

ServerLimit           80
StartServers          25
MaxClients          2000
MinSpareThreads       75
MaxSpareThreads      125
ThreadsPerChild        5
MaxRequestsPerChild    0

I started testing this configuration and while monitoring the server running 1,000 concurrent requests and the server looked like Apache was handling 1,000 requests just fine. I was running a simple command to output the sockets and httpd processes on the server during the load test:

while true
do
echo -----`date '+%r'` -----:
netstat -ant | awk '{print $6}' | sort | uniq -c | sort -n
echo httpd processes: [`ps aux | grep httpd | wc -l`]
echo .
sleep 30
done

Then when I was monitoring the load test, I was concerned about seeing 82 httpd processes running which was the ServerLimit I had set.

-----08:02:37 AM -----:
      1 established)
      1 Foreign
      4 CLOSE_WAIT
     17 LISTEN
     32 FIN_WAIT2
     41 ESTABLISHED
     69 FIN_WAIT1
    630 SYN_RECV
  45386 TIME_WAIT
[82] httpd processes
.

I now increased the load to my target of 2,000 concurrent requests and restarted the JMeter test and was able to get to around 1,800 concurrent request and started getting connection refused errors again.

I suspected that my Servers where maxed out and was not able to create anymore threads for those servers where having:

80 server * 5 threads each server == 400 requests processed concurrently

So I increased the number of threads to 25

80 server * 25 threads each server == 2,000 requests processed concurrently

To end up with this worker setting:

ServerLimit           80
StartServers          25
MaxClients          2000
MinSpareThreads       75
MaxSpareThreads      125
ThreadsPerChild       25
MaxRequestsPerChild    0

I was then able to turn the load up to 2,000 concurrent requests.

-----08:53:27 AM -----:
      1 established)
      1 FIN_WAIT2
      1 Foreign
      4 CLOSE_WAIT
     12 CLOSING
     17 LISTEN
    129 ESTABLISHED
    621 FIN_WAIT1
   1203 SYN_RECV
  55556 TIME_WAIT
[53] httpd processes

At this point we are only using 53 Servers and 2,000 clients. The tests sustained zero errors for 5 minutes during the test.

As a test I increased the ThreadsPerChild to 40 and run the load test against 3,000 concurrent requests.

I was able to get to around 2,800 concurrent requests then I started getting connection refused errors:

Error Count: 1
Response code: Non HTTP response code: org.apache.http.conn.HttpHostConnectException
Response message: Non HTTP response message: Connection to http://pasundtastgprt2:8001 refused

and I also started getting JMeter errors:

Response code: Non HTTP response code: java.net.BindException
Response message: Non HTTP response message: Address already in use: connect

So in the furure I would like to see how much further I can push the server and I think I can get to 3,000 concurrent and most likely far more than that on my current installation.

 

From http://www.baselogic.com/blog/development/adding-memory-jmeter/

Load testing Testing Requests

Opinions expressed by DZone contributors are their own.

Related

  • Load Testing Essentials for High-Traffic Applications
  • A General Overview of TCPCopy Architecture
  • How To Organize End-To-End Quality Assurance and Testing for E-Commerce Apps
  • Five Steps To Building a Tier 1 Service That Is Resilient to Outages

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!