3

I am setting up an apache configuration to check for the existence of a file. If the file exists, then the server will redirect to a maintenance page. If not, the application will get served up normally.

I'm concerned that with a large number of requests, that the file check has to happen on each individual request and could end up causing a large amount of unnecessary IO.

Is there IO overhead for checking the existence of a file?

If so, are there any alternatives to checking for the existence of a file?

I need to be able to modify something outside of apache that won't require a restart or graceful. For example, is there a module that allows querying a memcached instance for the presence of a key? or is there any other type of memory based cache that could be used?

3
  • 1
    I would imagine the file system cache would handle this in much the same way it handles all of the other files apache has to open. If you're planning to replace an active site with a check for a single file, then you shouldn't have to worry about the performance hit. May 11, 2012 at 22:45
  • 1
    @SmallClanger: This is the answer; make it one!
    – Andrew M.
    May 12, 2012 at 14:27
  • As you wish... :) May 13, 2012 at 17:06

1 Answer 1

1

I would imagine the file system cache would handle this in much the same way it handles all of the other files apache has to open. If you're planning to replace an active site with a check for a single file, then you shouldn't have to worry about the performance hit.

3
  • The concern is that the apache configuration would be setup to check for that file on every request even if the site is active. If the check passes (file exists) then the user is redirected to a separate site. As soon as the file is deleted, the redirection stops and the site loads normally. May 14, 2012 at 16:47
  • Is there a way to verify that the requests are hitting the file cache and not the disk? May 14, 2012 at 16:49
  • It will be. It's a tiny file that's being hit very frequently. After the first read it'll be permanently in memory. You shouldn't notice the difference at all. May 14, 2012 at 17:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .