TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How We Designed for Performance and Scale

293 pointsby fcambusalmost 10 years ago

9 comments

rdtscalmost 10 years ago
Btw there is a new feature in the kernel to help avoid using the accept shared memory mutex -- EPOLLEXCLUSIVE and EPOLLROUNDROBIN<p>This should round robin accept in the kernel, and not wake up all the epoll listeners.<p><a href="https:&#x2F;&#x2F;lwn.net&#x2F;Articles&#x2F;632590&#x2F;" rel="nofollow">https:&#x2F;&#x2F;lwn.net&#x2F;Articles&#x2F;632590&#x2F;</a>
评论 #9695501 未加载
naileralmost 10 years ago
This is a lovely article, but:<p>&gt; The fundamental basis of any Unix application is the thread or process. (From the Linux OS perspective, threads and processes are mostly identical; the major difference is the degree to which they share memory.)<p>It&#x27;s better to be specific in performance discussions, rather than use &#x27;thread&#x27; and &#x27;process&#x27; interchangeably.<p>As well as the article mentioned about memory sharing, threads (which are called Lightweight Processes, or LWPs, in Linux &#x27;ps&#x27;) are granular.<p><pre><code> ps -eLf </code></pre> NWLP in the command above is &#x27;number of lightweight processes&#x27;, ie number of threads.<p>Processes are not granular: they&#x27;re one or many threads. IIRC it can be beneficial to assign threads of the same process to the same physical core or same die for cache affinity. There&#x27;s all kind of performance stuff where &#x27;threads&#x27; and &#x27;processes&#x27; do not mean the same thing. Being specific is rad.
评论 #9695344 未加载
评论 #9697065 未加载
cshimminalmost 10 years ago
&gt; You can reload configuration multiple times per second (and many NGINX users do exactly that)<p>I thought this was an interesting remark. Can anyone clue me in to what these &quot;many users&quot; might be doing, that requires them to reload configuration so frequently?
评论 #9696866 未加载
评论 #9695059 未加载
评论 #9695242 未加载
评论 #9695007 未加载
nodesocketalmost 10 years ago
&quot;NGINX’s binary upgrade process achieves the holy grail of high-availability; you can upgrade the software on the fly, without any dropped connections, downtime or interruption in service.&quot;<p>Is this really true? I remember seeing an article[1] recently on using an iptables hack to prevent dropping connections when reloading haproxy. Does nginx actually provide zero-downtime configuration reloads?<p>[1] <a href="https:&#x2F;&#x2F;medium.com&#x2F;@Drew_Stokes&#x2F;actual-zero-downtime-with-haproxy-18318578fde6" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;@Drew_Stokes&#x2F;actual-zero-downtime-with-ha...</a>
评论 #9694339 未加载
评论 #9694330 未加载
评论 #9696020 未加载
评论 #9695142 未加载
评论 #9695005 未加载
评论 #9694206 未加载
ameliusalmost 10 years ago
One thread per CPU, and non-blocking I&#x2F;O, that&#x27;s sounds like the usual way to approach the problem. I&#x27;m surprised it uses state machines to handle the non-blocking I&#x2F;O, because modern software engineering provides much more pleasant approaches such as using coroutines.
评论 #9695181 未加载
评论 #9696136 未加载
McElroyalmost 10 years ago
I did as they said at the bottom and gave them my e-mail and other personal details so I could download the eBook that they were giving free preview copies of - &quot;Building Microservices&quot;. Unfortunately, they sent link to PDF only so it&#x27;s not usable to me. Just a heads up to others so you save yourself the time of discovering that. (I&#x27;ll just wait for when the book is finished and then I&#x27;ll buy it so I get ePub. I like O&#x27;Reilly and have bought many books there before.)
评论 #9696405 未加载
评论 #9696025 未加载
simi_almost 10 years ago
I had a feeling I&#x27;ve read about nginx before: <a href="http:&#x2F;&#x2F;aosabook.org&#x2F;en&#x2F;nginx.html" rel="nofollow">http:&#x2F;&#x2F;aosabook.org&#x2F;en&#x2F;nginx.html</a><p>The whole book is worth a read, although I found some sections painfully boring (perhaps my limited attention span is to blame).
评论 #9711682 未加载
saurabhtandonalmost 10 years ago
Interesting overview. I wish they had some data comparison which could explain the significance and efficiency of this approach vs other&#x2F;old approaches.
dschiptsovalmost 10 years ago
They forgot to mention pool-allocated buffers, zero-copy strings, and very clean, layered codebase - every syscall was counted.<p>The original nginx is a rare example of what is the best in software engineering - deep understanding of principles and almost Asperger&#x27;s attention to details (which is obviously good). Its success is justified.