I am along the way of reworking how the organization Sometimes for evolves websites. Within the old way, there have been frequently several duplicate php files that got known as to render a webpage. e.g page1.php?id=5, page2.php?id=7 where page1.php and page2.php were generally simply copies of the identical code. This duplication came into being consequently of attempting to aid and keep compatibility with legacy frameworks.

The brand new proposal, is basically a clean rewrite that routes each and every call although the same file using .htaccess, mod_rewrite etc.

I have been requested to exhibit however, the negative or positive impacts this transformation might have around the server.

Performs this approach to only using one file to process demands reduce server overhead or will it increase the likelihood of over-loading the server if your large number of persons visited a particular site. What are the tools that will have the ability to appraise the variations in performance to create this type of report?

Should you place the rules within the primary configuration rather than within an .htaccess file you'll minimize the performance impact that rewrites may have around the server.

Unless of course you've some complicated rewrite rules, the overhead that using rewrites will prove to add might not be also noticeable in benchmarks.

For performance impact that you can do simple benchmark with 2 tools in the apache community:

  • ab, that is good like a base-stress tool
  • httperf
  • There's also autobench that is built on the top of httperf which provides you with some nice graphs after playing some periods (session that may be acquired from an access.log analysis).

For rather easy impact test you may also use simple on-inserts like that one (alter the real site title and IP, requires netcat):

time printf 'GET / HTTP/1.1\nHost:www.google.com\n\n' | nc -w 10 -q 10 80 1>/dev/null

Mod-rewrite will not obtain a large impact, however, you should test drive it :-) For those who have lots of hyperlink to rewrite mod-rewrite includes a nice tool : rewriteMap. You'll write your url mapping within an exterior file, so when things is going to be ok you'll even have the ability to build an hashed version of the map file, so you will get an ashed index access for every url, this ought to be lightning fast.