Improving performance by using an additional static file server

Posted by Max on Server Fault See other posts from Server Fault or by Max
Published on 2010-04-10T09:05:58Z Indexed on 2010/04/10 9:13 UTC
Read the original article Hit count: 245

Filed under:
|
|
|

Hello there,

I´m planning for a large website that includes many static assets (js, css, images and thumbnails) in the generated pages. That website will use TYPO3 as CMS (is is a customer requirement).

I guess I could seriously improve performance / page load times by using a two server setup. One server where the main application (PHP) runs and another one where the static files sit being served by a trimmed down version of apache or something like lighthttpd.

Including e. g. js or css files from the file server is of course no big deal. Just use an absolute url http://static.example.com/js/main.js and be done with it.

But: that website will have pages with MANY thumbnails of e. g. product images on it. So I see two problems when the main application tries to create a thumbnail of some image:

  1. the original image like products/some.jpg is uploaded on the static file server and therefore not on the same server as the PHP application which tries to create the thumbnail.

  2. TYPO3 writes created thumbnails to a temp directory which is expected to be on the same server. Therefore, hundreds of thumbnails will be written and served from that temp directory which is on the same server as the main application -> the static file server is in that case basically useless, all thumbnails will be requested from the server of the main application.

So, my question is: how to overcome this shortcomings?

Is it possible to "symlink" some directories to another server?

So, for example, if PHP tries to open the original products image for thumbnail creation with imagecreate("products/some.jpg") the products folder actually "points" to the products folder on the static image server? I know something like this can be done with .htaccess but is it possible on file system level?

© Server Fault or respective owner

Related posts about linux

Related posts about apache