Seiden Group
Modern Development & Open Source for IBM i
  • Link to LinkedIn
  • Link to Mail
  • Home
  • Seiden PHP+
    • Seiden PHP+
    • Install & Learn
    • SmartSupport
    • PHP Migrations & Upgrades
    • Success Stories
    • Free PHP Assessment
    • Documentation
    • What’s New (Changelog)
  • IBM i Services
    • Development
    • Training & Mentoring
    • Open Source Setup & Upgrades
    • SSL/TLS Install & Learn
    • Performance
  • Support
    • Open Source & PHP
    • VS Code for i
    • Developer Support
    • Support Success Stories
  • VS Code for i
    • Support
    • Training
    • Code for i Resource Guide
    • Getting Started Videos
    • Code for IBM i Fridays
  • Free Stuff
    • IBM i Strategy & Tips
    • PHP Upgrade Assessment
    • CNX Valence Assessment
    • VS Code for IBM i Resources
    • Code for IBM i Fridays
    • QCachegrind Download
    • PHP Toolkit for IBM i Resources
    • Qshell on i Library
  • Blog
  • About
    • About Our Team
    • About Alan Seiden
    • Speakers & Sessions
    • In the News
  • Contact
  • 201.447.2437
  • Search
  • Menu Menu

Seiden Group Blog

Measure Performance Using IBM i Apache Directives

September 25, 2023/2 Comments/in Apache /by Alan Seiden

UPDATED August 21, 2025

Apache HTTP Server ProjectSpeed is critical when serving APIs and web pages. The IBM HTTP Server (powered by Apache) for i can log the speed of each request.

Here’s how to ensure that the web server will track HTTP request speed at the desired level of precision.

Check for the timing directive

The IBM i’s Create HTTP Server wizard produces a configuration file (httpd.conf) that includes this format string:

LogFormat "%h %T %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

The second directive above is %T. That means time, in seconds, for each complete round-trip request from a browser or API client to your Apache server and back.

If you do not see the %T, you can add it.

I sent a couple of requests to an Apache server that used this LogFormat string. Here’s what was logged:

10.6.4.169 3 - - [01/Jul/2025:12:09:09 -0400] "GET /api/getCustomerList HTTP/1.1" 200 11049946 "-" "AHC/1.0"

10.6.12.58 0 - - [01/Jul/2025:13:36:40 -0400] "POST /api/insuranceApplication HTTP/1.1" 200 107 "-" "AHC/1.0"

To see a precision finer than seconds, you can change the %T to %{ms}T for milliseconds, or %{us}T for microseconds (millionth of a second). The directive %{us}T is equivalent to %D. Below, I’ve included all three units of time:

LogFormat "%h secs/millisecs/microsecs: %T/%{ms}T/%{us}T %l %u %t \"%r\" %>s %b microsecs: %D \"%{Referer}i\" \"%{User-Agent}i\"" combined

Here is what the log requests look like after restarting the web server and submitting two more requests::

10.6.4.169 seconds/millisecs/microsecs: 3/324/3249688 - - [01/Jul/2025:14:12:14 -0400] "GET /api/getCustomerList HTTP/1.1" 200 11049946 "-" "AHC/1.0"

10.6.12.58 seconds/millisecs/microsecs: 0/105/105024 - - [01/Jul/2025:14:12:20 -0400] "POST /api/insuranceApplication HTTP/1.1" 200 107 "-" "AHC/1.0"

Find the slowdown, which might NOT be your fault

These timing directives can help diagnose slow performance between Cloud applications (NetSuite, Microsoft Dynamics 365, Salesforce, etc.) that may call an API gateway, which in turn calls your IBM i Apache API endpoint.

If you’re being told your API is slow, review the timing in your Apache access logs. Add more precise timing measurements if needed. If the slowness is on your end, fix it. If not, show them the log that was generated, demonstrating that the issue must be further up the chain.

To eliminate network delays

Because the %T timing directives measure the complete round-trip from browser or API client to your server and back, the response time includes any network delays. To reduce or eliminate network delays in your timing, my trick is to call my IBM i application directly from the IBM i server using curl.

Learn more about Apache Log Directives

For details of each logging option (%h, %T, %l, etc.) in the LogFormat string above, and other logging elements you can add, see the Apache documentation’s Custom Log Formats section.

These directives are another example of how good the Apache Web server is and how its IBM i integration makes things simpler. For additional help in getting the most from your Apache Web Server, see Apache for IBM i: Where to Find Documentation.

Tags: Apache, API, IBMi, performance
Share this entry
  • Share on Facebook
  • Share on X
  • Share on Pinterest
  • Share on LinkedIn
  • Share on Tumblr
  • Share on Reddit
  • Share by Mail
https://www.seidengroup.com/wp-content/uploads/2017/03/SeidenLogo-180.png 0 0 Alan Seiden https://www.seidengroup.com/wp-content/uploads/2017/03/SeidenLogo-180.png Alan Seiden2023-09-25 12:15:332026-07-08 09:17:42Measure Performance Using IBM i Apache Directives
Alan Seiden

About Alan Seiden

Alan works to preserve your investment in IBM enterprise systems by designing and implementing modernization strategies that leverage your existing business logic.

With a passion ...Read More

2 replies
  1. Felipe
    Felipe says:
    October 3, 2023 at 9:47 am

    Great tip, we’ve started working with IWS and I thinks this could be very helpful, thanks!

    Reply
    • Alan Seiden
      Alan Seiden says:
      October 4, 2023 at 1:45 pm

      Felipe, happy to help! Wishing you success with your IWS projects. If you choose the Apache web server option with IWS, you get all the Apache features, such as the performance timer described here.

      Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

SUBSCRIBE
Open Thinking
Monthly IBM i Strategy & Tips
  • This field is for validation purposes and should be left unchanged.

IBM i Development

  • RPG, COBOL, SQL, Node,
    PHP, Python, Valance, etc.
  • Modernization. Integration.
  • Web and API Solutions
  • Legacy Maintenance
    ...
LET'S GET IT DONE!

Recent Posts

  • Do You Need IBM i Observability?
  • PHP 8.6 is Coming Soon to IBM i
  • Safer npm installation is on the way for Node.js (and all JavaScript)
  • Access Modern Security for IBM i and Connected Web Environments
  • IBM i: A Natural Platform for Agentic AI
  • PHP on IBM i in 2026: The Modernization Engine
  • Your “AS/400” Is a Modern IBM i Platform
  • MCP + AI for IBM i Teams (with a MongoDB example)
  • GnuPG PHP Extension for IBM i: Now Included with Seiden Support
  • Getting Started with Code for IBM i: A Lunch & Learn Video

SEIDEN GROUP: Modern Development & Open Source for IBM i

Home   |   Seiden PHP+   |   IBM i Services  |   Support   |   VS Code for i   |   Free Stuff   |   Blog  |   Privacy Policy  |   Contact         201.447.2437

© 2026 Seiden Group, LLC
  • Link to LinkedIn
  • Link to Mail
Link to: RPG Rocks! A Musical Tribute to IBM i Developers Link to: RPG Rocks! A Musical Tribute to IBM i Developers RPG Rocks! A Musical Tribute to IBM i Developers Link to: IBM i Apache Security Setting: RequestReadTimeout Link to: IBM i Apache Security Setting: RequestReadTimeout IBM i Apache Security Setting: RequestReadTimeout
Scroll to top Scroll to top Scroll to top