Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2001
    Posts
    161

    most efficient way to serve images?

    is serving images from mysql blob far less cpu efficient than just serving them normally from apache or thttpd? any opinions on what is the most efficient method/platform for serving images?

  2. #2
    Join Date
    Jan 2003
    Posts
    1,715
    Retrieving blobs from mysql is far less efficient, yes. If for no other reason, you have more context switches as the CPU bounces between mysql and httpd. Depending on the resources you have available, the difference may not matter, but it's there.

    If performance makes a difference, add a caching layer, either in PHP or something like squid.
    Game Servers are the next hot market!
    Slim margins, heavy support, fickle customers, and moronic suppliers!
    Start your own today!

  3. #3
    Join Date
    Oct 2001
    Posts
    161
    will that caching layer minimize the blob inefficiency, or is it for something else?

  4. #4
    Of the 3 listed, thttpd uses the least resources.
    ••• Like us on Facebook to qualify for discounts! •••
    ••• http://www.sprintserve.net •••
    ••• Offering: | Internap FCP Bandwidth! | Rebootless Kernel Updates! | Magento Optimized Hosting | Wordpress Hosting | •••
    ••• Services: | Managed Multiple Cores 64bit Servers | Server Management | •••

  5. #5
    Join Date
    Jan 2003
    Posts
    1,715
    The caching is to streamline blobs. The layer saves the images it pulls from mysql as files. That way you can maintain the organizational quality of blobs, but serve them as files when possible.
    Game Servers are the next hot market!
    Slim margins, heavy support, fickle customers, and moronic suppliers!
    Start your own today!

  6. #6
    Join Date
    Mar 2003
    Posts
    345
    Will this be an efficience way to server images :

    My RedHat 9.0 server has 5 IP address:
    - I run apache 2.0.49 on IP A to serve HTML and PHP
    - I run thttpd on IP B to serve IMAGES

    Compared to:
    - I run apache 2.0.49 on IP A for all

    One thing why I run apache is that it can 'compress' (via mod_deflate) html or text output, and it can set expiration (mod_expire) ... this is for saving bandwidth (in my understanding). Can I do this with thttpd ?

  7. #7
    Join Date
    Apr 2003
    Location
    Los Angeles, CA
    Posts
    820
    I think having thttpd running on a separate IP to only serve images is pretty efficient, especially if you patch thttpd to support keep alives (to reduce TCP overhead). Patch at: http://halplant.com:88/software/patc...ep-alive.patch

    mod_deflate will not do you any good for images (except consume CPU power) since you can't really compress images much using the deflate method.

    As far mod_expire, well you could patch thttpd yourself to send an expiration header of say 1 hour with each request. Only if you need it... I guess.

  8. #8
    Join Date
    Jan 2003
    Posts
    1,715
    thttpd has very little flexibility, which is one of the main reasons it's so thin. Separate instances of apache and something thin like thttpd are common and work well.

    All of this assumes you do a decent amount of traffic, of course. If you're plodding along at 5 req/sec, this is a lot of fretting over nothing.
    Game Servers are the next hot market!
    Slim margins, heavy support, fickle customers, and moronic suppliers!
    Start your own today!

  9. #9
    Join Date
    Mar 2003
    Posts
    345
    I am serving quite large flash file (on average is 500 KB). So I need to make my web server as efficient as possible.

    But now I doubt of using thttpd because it cant send expiration header.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •