php - Should Nginx Be Combined With Language Supporting Asynchronous Programming Model? -


i found there lot of articles comparing nginx , apache in internet. however, these comparisons based on stress test web server running php code. suppose due apache deployed php lamp architecture.

in understanding, nginx created solve c10k problem event-based architecture. is, nginx supposed serve m concurrent requests n threads/processes. n supposed less m. big difference apache needs m threads/processes serve m concurrent requests.

for php code, programming model not asynchronous. each web request occupy 1 thread/process php handle it. so, don't understand meaning compare nginx , apache php code.

the event-based architecture of nginx must excels apache when requests involves i/o operations. example, requests need merge results multiple other web services. apache+php, each requests might takes seconds waiting i/o operation complete. consume lot of threads/processes. nginx, not problem, if asynchronous programming used.

would make more sense deploy nginx language supporting asynchronous programming model?

i'm not sure programming language dig potential nginx, id not php.

first , foremost, nginx not support application execution directly. can serve static files, proxy requests other webserver , other small things. historically, nginx aimed handle many network connections, true, rationale this: until apache respond request of on slow connection, can nothing. apache has limit of workers, when there lots of slow clients, new have wait until worker finishes transfer , resumes accepting new request. classic setup nginx accepting external requests, proxying them local apache; apache handles requests , gives responses nginx transfer clients. apache eliminated dealing clients.

regarding question , nginx in picture. it's not hard utilize system event frameworks these days. that's epoll linux, kqueue freebsd , others. @ application level lots of choices, twisted python example. have write application these frameworks, 1) put in async world , 2) give way build http service, ready backend nginx. that's aiming at.

so, c10k doesn't seem problem nginx, nor applications built around these frameworks. example @ hand friendfeed's tornado server: python written, uses epoll , kqueue depending on system, handles 8k easyly, recall. there benchmarks , afterthought scale further.

something must brewing in ruby world async trend, can come with, if haven't already. ruby's passenger , mongrel, whatever in essense (i'm blanking on this), work nginx, , required writing modules nginx. community takes nginx account , when needs to.

php, way, stays relevant pushes when websockets massively deployed. oh well.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -