服务器设计模式/最佳实践的最佳来源是什么?

发布于 2024-11-07 11:49:43 字数 243 浏览 0 评论 0原文

我已经寻找一本涵盖服务器设计模式的好书一段时间了。我正在寻找类似《四人帮》的东西。

概念包括:

--线程、进程、基于组合的解决方案
-- 如何正确分类请求。即我预计来自任何域的请求都是有限的,因此我只能为每个域分配一定数量的工作人员。
-- 工作线程超时
-- poll/select/epoll 用例
——还有那些我不知道的事情!

有什么建议请提出来!

谢谢!

I've searched for a while for a good book which covers server designed patterns. I'm looking for something along the lines of Gang of Four.

Concepts include:

-- Threaded vs Process vs combo based solutions
-- How to triage requests properly. i.e. I expect only limited requests from any domain, so I may only allocate a certain number of workers per domain.
-- Worker timeouts
-- poll/select/epoll use cases
-- And those things I don't know!

Any suggestions please!

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

予囚 2024-11-14 11:49:43

两本非常有用的书:

企业集成一书
模式提供了一致的
词汇和视觉符号
描述大规模集成
跨多个实施的解决方案
技术。它还探索了
详细说明优点和局限性
异步消息传递
架构。您将学习如何
连接的设计代码
应用到消息系统,如何
将消息路由到正确的
目的地以及如何监控
消息系统的健康状况。这
书中的图案是
与技术无关且栩栩如生
以及在不同环境中实现的示例
消息传递技术,例如 SOAP、
JMS、MSMQ、.NET、TIBCO 和其他 EAI
工具。

Two very useful books:

The book Enterprise Integration
Patterns provides a consistent
vocabulary and visual notation to
describe large-scale integration
solutions across many implementation
technologies. It also explores in
detail the advantages and limitations
of asynchronous messaging
architectures. You will learn how to
design code that connects an
application to a messaging system, how
to route messages to the proper
destination and how to monitor the
health of a messaging system. The
patterns in the book are
technology-agnostic and come to life
with examples implemented in different
messaging technologies, such as SOAP,
JMS, MSMQ, .NET, TIBCO and other EAI
Tools.

你与清晨阳光 2024-11-14 11:49:43

Unix 环境中的高级编程,第二版 是学习Unix系统编程的细节。它写得非常好(我最喜欢的英语书籍之一),深度非常好,并且对四种常见环境的关注(在出版时)有助于确保它的全面性。它并不算太过时——较新操作系统中的新功能可能对特定问题非常有用,但这本书确实很好地涵盖了基础知识。

当然,缺点是 APUE2nd 错过了一些出色的第三方工具,例如 libevent< /a>,这可以使基于套接字的服务器编程变得更加容易。 (并自动选择 select(2)poll(2)epoll(4)kpoll< 中的“最佳” /code>,以及针对平台的 Windows 事件处理。)

至于在线程和进程之间进行选择,归结为:您希望/需要在任务之间共享多少内存?如果每个进程都可以相对独立地运行,则进程可以提供更好的内存保护并且不会造成速度损失。如果进程需要与彼此的对象或单个线程“拥有”的对象进行交互,则线程可以提供更好的原语来共享数据。 (但许多人会认为线程的共享内存会引发有趣且令人兴奋的错误。这取决于情况。)

Advanced Programming in the Unix Environment, 2nd Edition is a fantastic resource for learning the details of Unix systems programming. It's extremely well-written (one of my favorite books in the English Language), the depth is excellent, and the focus on four common environments (at the time of publication) help ensure that it is well-rounded. It's not too badly out of date -- new features in newer operating systems may be fantastic for specific problems, but this book really covers the basics very well.

The downside, of course, is that APUE2nd misses out on some fantastic third-party tools such as libevent, which can make programming sockets-based servers significantly easier. (And automatically picks the 'best' of select(2), poll(2), epoll(4), kpoll, and Windows event handling, for the platform.)

As for choosing between threads and processes, it comes down to: how much memory sharing do you want / need between tasks? If each process can run relatively isolated, processes provide better memory protection and no speed penalty. If processes need to interact with each other's objects, or objects 'owned' by a single thread, then threads provide better primitives for sharing data. (But many would argue that the shared memory of threads is an invitation to fun and exciting bugs. It Depends.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文