Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7599619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:42:24+00:00 2026-05-30T22:42:24+00:00

I have an html directory filled with very small PHP scripts that do nothing

  • 0

I have an html directory filled with very small PHP scripts that do nothing but transform query string parameters to a redirect.

The apache server, which takes ~60K requests per day is not configured with any fast cgi/mod cgi (i’m not sure the correct term here), and it’s not a particularly beefy machine, so I hesitate to add significant overhead to the logic in these scripts.

What I must do is introduce a lookup into an associative array or equivalent so a string in the inbound URL can be mapped to a number (a string really) on the outbound url.

My fear is that if I introduce a MySQL query on every request, I’ll kill the performance.

Likewise, if I include a PHP file containing the definition of an array with 1000 items, I fear the lack of any memory resident PHP interpreter will cause a similar amount of overhead.

I had the thought to write a shell script and leverage the _ENV global, but I wonder if that’s going to be just as much overhead.

Any thoughts from a more experienced LAMP developer would be greatly appreciated.

Possible answers:

  • tell me that configuring an apache integrated PHP is nothing to fear and give me a link to some instructions
  • tell me that a MySQL query for each request is negligible overhead
  • tell me that including a large array definition on reach request is negligible overhead
  • …some other idea…
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T22:42:26+00:00Added an answer on May 30, 2026 at 10:42 pm

    What if we told you to “test it and see”?

    If you have memory, MySQL should be negligible. It’s a socket hit to a memory cache of a simply query.

    If you have CPU, the PHP module will likely not be noticeable.

    If you have neither, you’re doomed either way :).

    60K requests per day, over an 8 hour day, is 2 transactions per second. That’s really not a lot of traffic. No doubt you have spikes and heavier and quieter times. But even still.

    Embedding PHP in to apache will, in general, speed things up. But not by as much as you think. The cost of the startup is the fork and creation of the process, but the PHP interpreter code is already loaded in to RAM somewhere else (likely if you have requests overlapping), or minimally in disk cache. So it will be measurable, can’t say it will be noticeable. (Sprinkle “it depends” like fairy dust all over all of these statements, right?)

    Simply put, if you can test it, I’d test the 1000 lines in the php map and see how it goes. For a simple example, just time it from the command line (several times) and see what the difference is. This file will likely stay hot in the file cache, so I/O will be minimal, thus putting the bulk of the burden on the PHP interpreters parser (and thus CPU).

    You say you don’t have a beefy machine, so I don’t know what that means, but modern “slow” machines are “pretty beefy(tm)”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have HTML pages that I put inside temp folder(Outside WEB-INF directory). I have
How to find all files in directory? I have HTML page in some directory.
Trying to solve a problem with templatetags. I have two templatetags: @register.inclusion_tag('directory/_alphabet.html') def alphabet_list(names):
I have directory with > 1000 .html files, and would like to check all
I have HTML that includes symbols such as the Trademark TM as superscript (™).
I have html code that looks roughly like this: <div id=id1> <div id=id2> <p>some
I have a number of files that are stored on the server, but not
i have some html files as part of a regular website that has been
I have a few HTML files that I'd like to include via tags in
I have help.html file in resource directory. I can open it from Eclipse these

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.