hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : Nginx NAS serving large files
Reply

Hosting Security and Technology Configuring and optimizing web hosting servers and operating systems, developing administration scripts, building servers, protecting against hackers, and general security (SSL certificates, etc.)
Forum Jump

Nginx NAS serving large files

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 10-21-2011, 01:57 AM
central10 central10 is offline
Junior Guru Wannabe
 
Join Date: Sep 2010
Posts: 34

Nginx NAS serving large files


Hello Ladies and Gentlemen,

We have a very frustrating problem with a NAS configuration that we recently set-up. After running a filesharing website on 8 servers for 1+ years we decided to switch to a NAS configuration. We set-up our NAS (24x1TB Raid 5) to serve files to 9 front end servers over a private switch - doing 9 servers on 1 disk(logical)... not sure if nginx can handle this. Since we've moved to the NAS BW usage has dropped significantly even though our traffic has stayed the same. Download speeds are pretty bad aswell but this is due to IO issues that are being created by NGINX. so here's the problem we are facing...

In theory nginx is creating an io bottleneck because it's opening to many times without closing. We're using nginx to serve files to our 9 front end servers - each file will stay alive though for 45+ minutes. Instead of opening it for 10 seconds, reading into memory, and closing - it's opening it for 10 seconds, reading into memory, streaming it for 45 minutes, THEN closing. We ran a test with nginx and we were only able to download at 30kbps on port 182, how-ever over apache we were able to reach speeds of 20mb/s.

We've re-compiled nignx and installed the most recent stable version but that didn't fix anything.

Can someone please suggest a fix here? I've ran out of ideas...

Thank you!

Reply With Quote


Sponsored Links
  #2  
Old 10-21-2011, 02:08 AM
tanfwc tanfwc is offline
Web Hosting Master
 
Join Date: Apr 2004
Location: Singapore
Posts: 1,459
How big is each file size? Do you plan to enable caching on each nginx node so it does not reach your NAS for each file access?

__________________
tanfwc

Reply With Quote
  #3  
Old 10-21-2011, 11:36 AM
central10 central10 is offline
Junior Guru Wannabe
 
Join Date: Sep 2010
Posts: 34
Hello Tan,

Each file is anywhere from 40mb up to 1GB. We have nginx configured to cache files aswell as the diskcache in linux.

This is a very frustrating problem. Were paying big bucks for our servers but aren't getting much use out of them.

Reply With Quote
Sponsored Links
  #4  
Old 10-21-2011, 12:46 PM
tanfwc tanfwc is offline
Web Hosting Master
 
Join Date: Apr 2004
Location: Singapore
Posts: 1,459
You might want to check your nginx configuration because nginx has been performing real good on my setup.

__________________
tanfwc

Reply With Quote
  #5  
Old 10-21-2011, 02:39 PM
central10 central10 is offline
Junior Guru Wannabe
 
Join Date: Sep 2010
Posts: 34
We've made many changes to the nginx config but there are no performance changes.

What type of configuration are you operating on?


Last edited by central10; 10-21-2011 at 02:46 PM.
Reply With Quote
  #6  
Old 10-21-2011, 04:21 PM
twikamltd twikamltd is offline
Web Hosting Evangelist
 
Join Date: Nov 2006
Posts: 465
You're using nginx on the NAS server to serve the frontends? Wouldn't it make more sense to use Nginx on the frontends only and use something like NFS to connect to the NAS and also have some degree of caching on the frontends?

__________________
Twikam LTD
UK cPanel hosting • Super fast UK shared hosting with IP's and SSL
UK VPS Hosting High Bandwidth VPS Servers

Reply With Quote
  #7  
Old 10-24-2011, 04:57 PM
central10 central10 is offline
Junior Guru Wannabe
 
Join Date: Sep 2010
Posts: 34
Quote:
You're using nginx on the NAS server to serve the frontends? Wouldn't it make more sense to use Nginx on the frontends only and use something like NFS to connect to the NAS and also have some degree of caching on the frontends?
Sorry for my poor explanation. We are using the box with NFS and we have the fronends using nginx. We've re-compiled nginx with the developers version how-ever that too didn't solve the problem.

Are there any other possible configurations because as of now we are out of ideas. Maybe we could do something else either then using a NFS...???

Any help is much appreciated.

Reply With Quote
  #8  
Old 10-24-2011, 07:22 PM
UnixCabin UnixCabin is offline
WHT Addict
 
Join Date: Jul 2009
Posts: 163
Wait..... I'm confused... What communication protocol are you using? NFS?

Reply With Quote
  #9  
Old 10-24-2011, 08:07 PM
central10 central10 is offline
Junior Guru Wannabe
 
Join Date: Sep 2010
Posts: 34
Quote:
Originally Posted by UnixCabin View Post
Wait..... I'm confused... What communication protocol are you using? NFS?
We have a Network File System set-up between our front end servers and our NAS server. Nignx is on on all of our front end servers and is used to serve files to users.

Were open any ideas...

Reply With Quote
  #10  
Old 10-24-2011, 10:01 PM
silasmoeckel silasmoeckel is offline
Aspiring Evangelist
 
Join Date: Apr 2010
Posts: 440

Reply With Quote
  #11  
Old 10-25-2011, 11:34 AM
central10 central10 is offline
Junior Guru Wannabe
 
Join Date: Sep 2010
Posts: 34
Hello,

That caching plugin isn't going to be applicable to us, we couldn't cache ~5tb files in ram. What we need is a change in the underlying way nginx operates with opening files.

Reply With Quote
  #12  
Old 10-25-2011, 03:50 PM
mistwang mistwang is offline
Web Hosting Guru
 
Join Date: Nov 2003
Posts: 294
NFS latency will kill the performance of event-driven web server when streaming large static file from NFS backend, that's for sure.
cache wont help, only one possible tweak is to enable AIO, but I am not sure how robust nginx AIO implementation is, or its AIO have any effect on NFS.

__________________
LiteSpeed Web Server by http://www.litespeedtech.com
Best PHP and Ruby On Rails hosting platform,
Completely Apache interchangeable
Compatible with all hosting control panels.

Reply With Quote
  #13  
Old 10-26-2011, 11:55 PM
Steven Steven is online now
I like ice cream
 
Join Date: Mar 2003
Location: California USA
Posts: 11,773
Quote:
Originally Posted by mistwang View Post
NFS latency will kill the performance of event-driven web server when streaming large static file from NFS backend, that's for sure.
cache wont help, only one possible tweak is to enable AIO, but I am not sure how robust nginx AIO implementation is, or its AIO have any effect on NFS.
How well would litespeed work in this instance.
Would you meet the 20mb/s he did with apache?

__________________
Steven Ciaburri | Proactive Linux Server Management - Rack911.com | 1.855.RACK911
System Administration Extraordinaire

Managed Dedicated Servers, Linux Server Management, Disaster Recovery, Server Security Audits

Reply With Quote
  #14  
Old 10-27-2011, 12:28 AM
mistwang mistwang is offline
Web Hosting Guru
 
Join Date: Nov 2003
Posts: 294
Does not like AIO implementation in other web servers, which only work with direct I/O access mode, Seems linux NFS AIO implementation is still a work in progress.

LiteSpeed AIO works with buffered I/O, can take advantage of kernel cache memory.
I have not done much testing with AIO under NFS, so I cannot be very sure. It is also depends on Linux NFS client implementation. I will give it a try when I get a chance, the result will be interesting.

__________________
LiteSpeed Web Server by http://www.litespeedtech.com
Best PHP and Ruby On Rails hosting platform,
Completely Apache interchangeable
Compatible with all hosting control panels.

Reply With Quote
  #15  
Old 10-27-2011, 08:25 AM
File1eu File1eu is offline
Web Hosting Guru
 
Join Date: Sep 2010
Location: Behind you...
Posts: 329
You can try opening the file in smaller chunks instead of opening it at once. Maybe NFS+nginx creates a bottleneck when it tries to open a large amount of data at once?

__________________
file1.info :: 50GB secure cloudstorage with filemanager

Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Serving up Compressed Files? Ariolander Web Design and Content 0 02-11-2010 01:24 PM
Speed up serving large files? Khao8 Hosting Security and Technology 8 12-09-2009 11:47 AM
Serving Files with PHP Adam Hallett Programming Discussion 9 12-29-2007 12:44 AM
Serving large files Force Hosting Security and Technology 10 05-04-2005 09:17 PM
serving large files through apache eL-ankebut Dedicated Server 11 05-01-2005 10:46 AM

Related posts from TheWhir.com
Title Type Date Posted
Apache Market Share Dips Slightly in June Netcraft Web Server Survey Web Hosting News 2013-06-06 13:40:21
nginx Version 1.4.0 Supports SPDY Protocol Web Hosting News 2013-04-29 15:08:14
Nginx Aims to Grow Market Share Under New CEO Gus Robertson Web Hosting News 2013-04-08 14:28:48
NGINX Introduces Commercial Support for Open Source Web Server Web Hosting News 2012-02-07 14:43:26
Web Server NGINX Partners With CDN Firm Jet-Stream Web Hosting News 2011-11-21 19:21:42


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?