Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: File Descriptors
PostPosted: Sat Mar 10, 2007 5:10 am 
Offline
Senior Newbie

Joined: Sat Mar 10, 2007 4:50 am
Posts: 5
I have looked around your forums and over your website, and am considering purchasing a linode from you.

As far as I can see, pretty much everything is upgradeable, apart from the number of file descriptors, which is 1024.

I have had a quick look at wikipedia about file descriptors, but am none the wiser. I want to run a simple, but high volume, LAMP website that makes heavy use of caching.

Can you help me get a handle on what factors are relevant in determining in advance how many file descriptors such a site is likely to use? (My technical knowledge goes little beyond running my own server and being able to compile from tarballs).

What - in laymans terms - consumes file descriptors? If my php script uses a hige number of includes is that going to use up more descriptors than a monolithic script? If I open 100 connections to mysql at one time, does each connection use a file descriptor? If I cache html pages to disk is THAT going to increase my use of file descriptors....

Many thanks


Top
   
 Post subject:
PostPosted: Sat Mar 10, 2007 7:05 am 
Offline
Senior Member
User avatar

Joined: Tue Jan 04, 2005 7:32 am
Posts: 277
Website: http://www.betadome.com/
Location: Ă…lesund, Norway
Skype: neonnero
Twitter: neonnero
I assume you're referring to this FAQ item:
http://www.linode.com/products/faq.cfm?id=19

One file descriptor is any file handle that is open by a process at any time. Meaning, a limit of 1024 file descriptors means that you can't have more than 1024 open files (including sockets to servers/ports) at any given time. If we also assume that a page served takes less than 1 second to process by PHP (and since PHP closes all open file handles at the end of script execution), and subtract the number of processes running, you can have a maximum of roughly 500 visitors at any given second (leaving room for several client processes of both Apache and MySQL).

Basically, if you need more than that to begin with, you really need a fully-dedicated server (considering that Wikipedia has statistically a little less than 10 requests at any given second).

As the FAQ answer says, with the number of file descriptors set to a maximum of 1024, it's set very high.

I hope this was slightly more descriptive.


Top
   
 Post subject:
PostPosted: Sat Mar 10, 2007 8:05 am 
Offline
Senior Newbie

Joined: Sat Mar 10, 2007 4:50 am
Posts: 5
Thank you for your prompt and informative reply.

>As the FAQ answer says, with the number of file descriptors set
>to a maximum of 1024, it's set very high.

The faq entry you reference actually states that the <b>process</b> limit is set very high, and that the file descriptors are limited to 1024. It does not indicate whether this latter is "high" or "moderate". Hence my original question.

Can I clarify - if my main php script includes say - 30 or so php files, does each include consume a file descriptor until script execution ends? If so, this is worth knowing as it is something I can change.

I appreciate that 500hits/minute may seem like a lot - but the particular application in question is serving xml out of mysql to a google map overlay, and thus each drag of the map requires multiple very simple "hits". A single user may thus consume 3 to 6 hits/second without breaking sweat. Given that peak hit values are always rather greater than average, that putative "500 hits/second" soon gets consumed....

Naturally, it is fairly heavily optimized - heap tables in mysql and heavy caching - so it ends up not terribly resource intensive in cpu terms. But the file descriptor limit on linode is set hard, and I don't want to run in to it, as I can't "upgrade" my way out of it.

best wishes


Top
   
 Post subject:
PostPosted: Sat Mar 10, 2007 8:21 am 
Offline
Senior Newbie

Joined: Sat Mar 10, 2007 4:50 am
Posts: 5
silly me...

>500hits/minute

should naturally have ben 500hits/second

regards


Top
   
 Post subject:
PostPosted: Sat Mar 10, 2007 4:29 pm 
Offline
Senior Newbie

Joined: Wed Nov 08, 2006 3:06 pm
Posts: 14
File Descriptors should be okay, I'd be more concerned with running out of IO Tokens if your expecting so many hits. Might be an idea to wait for someone like caker to respond, not totally sure.


Top
   
 Post subject:
PostPosted: Sat Mar 10, 2007 7:37 pm 
Offline
Linode Staff
User avatar

Joined: Tue Apr 15, 2003 6:24 pm
Posts: 3090
Website: http://www.linode.com/
Location: Galloway, NJ
NeonNero wrote:
I assume you're referring to this FAQ item:
http://www.linode.com/products/faq.cfm?id=19

That FAQ entry is no longer true. I can't recall the exact details, but that only applied to older UML kernels / and or the kernel we used to run on the host.

The only fd limit in UML that exists now is the value you set in the kernel's settings: /proc/sys/fs/file-max. There is no limit set by Linode or UML.

-Chris


Top
   
 Post subject:
PostPosted: Sun Mar 11, 2007 12:52 am 
Offline
Senior Member
User avatar

Joined: Tue Jan 04, 2005 7:32 am
Posts: 277
Website: http://www.betadome.com/
Location: Ă…lesund, Norway
Skype: neonnero
Twitter: neonnero
caker wrote:
NeonNero wrote:
I assume you're referring to this FAQ item:
http://www.linode.com/products/faq.cfm?id=19

That FAQ entry is no longer true. I can't recall the exact details, but that only applied to older UML kernels / and or the kernel we used to run on the host.

The only fd limit in UML that exists now is the value you set in the kernel's settings: /proc/sys/fs/file-max. There is no limit set by Linode or UML.

-Chris


I guess it's time to either remove or update that FAQ entry, then? (With a hint towards the /proc/sys/fs/file-max settings file, that is.)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group