本文提供的技术能有效地降低程序的争用代价,并增大程序在出现非线性伸缩行为之前所能承受的负载。
The techniques presented in this article are effective for reducing the cost of contention in your programs, and increasing the load they can bear before exhibiting nonlinear scaling behavior.
如果想编写具可伸缩性的多线程程序,我们就必须减少对临界资源的争用。
If we want to write scalable multithreaded programs, we must reduce contention for critical resources.
所以,在调试应用程序中同步的使用时,我们应该努力减少实际争用的数目,而根本不是简单地试图避免使用同步。
In tuning an application's use of synchronization, then, we should try hard to reduce the amount of actual contention, rather than simply try to avoid using synchronization at all.
对于所有这些情况,驻留在相同的队列管理器上的集群和应用程序是直接争用资源的。
In all of these cases, the cluster and the applications are in direct competition when they are hosted on the same queue manager.
对于某些应用程序的使用模式,这明显可以减少所使用连接的总数量,从而减少潜在的争用和供给不足问题。
For some application usage patterns, this can obviously reduce the total number of connections in use, and thus the potential for contention and starvation.
一旦打印机闲置,后台处理程序就可以将作业发送到打印机,而不必担心其他打印作业争用。
Once the printer is unused, the spooler can send the job to the printer without fear of contention from other print jobs.
当然,当应用程序和集群储存库争用有限的资源时,还存在许多其他交互。
Of course, there are many other interactions when applications and the cluster repository compete for limited resources.
它提供关于GC使用的建议、识别热方法、突出显示锁争用区域,提供关于应用程序的运行环境的信息。
It makes recommendations on GC usage, identifies hot methods, highlights areas of lock contention, and provides information on the environment the application is running in.
如果只有几个应用程序并发地运行,则可以增大 MAXLOCKS,因为在这些条件下锁列表空间中不会有太多争用。
You can increase MAXLOCKS if only a few applications run concurrently, because there will not be a lot of contention for the lock list space under these conditions.
但在应用这些技术之前,您必须首先分析您的程序,以判断哪里可能出现争用。
But before you can apply these techniques, you first have to analyze your program to determine where contention is likely to occur.
如果您有一个应用程序(其写入争用可能成为伸缩基于云的应用程序的真正障碍),那么事件来源就是值得考虑的事项。
Event sourcing is worth considering if you have an application for which write contention is likely to be a real barrier to scaling your cloud-based application.
在您尝试伸缩应用程序时,常遇见的问题是数据库中的写入争用。
A common problem as you try to scale applications is write contention in the database.
一个简单的应用程序示例将帮助您了解如何使用JLA帮助查找锁争用的区域。
A simple example application will help you understand how you can use the JLA to help find areas of lock contention.
我们还通过找出与分页争用内存的应用程序和进程的数量来确定每秒内存分页。
We also determined the paging per second by looking at the number of applications and processes contending for the memory allocated for paging.
尽可能使用索引来减少消息流实例和应用程序之间的争用。
Use indexes wherever possible to reduce the contention between message flow instances and applications.
调优工作应该度量这些资源,然后在应用程序、应用服务器和服务器中做相应的调整,确保不出现资源争用。
Your tuning endeavors should center on measuring these resources and making adjustments in your application, application server, and servers to make sure there is no contention for resources.
因此,您数据库中的锁争用将明显降低,并且您的应用程序服务器具有更短且更分散的工作单元,这将降低CPU和JVM的内存开销。
Thus, the lock contention is significantly reduced in your database, and your application server has shorter and more discrete units of work, which reduces CPU and JVM memory overhead.
当发生死锁时,这个监控器收集相关应用程序、死锁中的sql语句以及引起高争用的锁的信息。
When a deadlock occurs, it collects information about the applications involved, the SQL statements participating in the deadlock, and the locks causing high contention.
在一个锁关键型应用程序中,多个线程在相同的锁上争用。
A lock-bound application is one in which multiple threads are fighting over the same locks.
并且无争用同步和争用同步间的性能损失差别很大;一个简单的测试程序指出争用同步比无争用同步慢50倍。
The cost difference between an uncontended synchronization and a contended one is huge; a simple test program suggested that a contended synchronization is 50 times slower than an uncontended one.
例如,应用程序可能争用线程、后台连接等等。
For example, applications might compete for threads, backend connections, and so on.
大多数锁都不是频繁争用的,所以改善非竞争锁定的性能可以实际地改善应用程序的整体性能。
Most locks are not frequently contended, so improving the performance of uncontended locking can improve overall application performance substantially.
但是,如果应用程序没有进行过精心设计,则这种机制可能会导致更高级别的争用。
However, this mechanism can cause high levels of contention if applications aren't designed with care.
争用同步会严重影响程序的可伸缩性。
Contended synchronization can have a serious impact on the scalability of your programs.
确定问题锁后,您应该重写应用程序来减少该锁的争用。
Once you have identified problematic locks, you should rewrite the application to reduce the contention on the lock.
另一种管理数据库中写入争用的方法是为一些或所有应用程序数据评估使用NoSQL数据存储的可能性。
Another approach to managing write contention in the database is to evaluate the possibility of using NoSQL data stores for some or all of your application data.
为了减少信号量争用问题,Domino应用程序开发人员在设计应用程序时应该牢记以下原则。
To reduce or minimize semaphore contention issues, Domino application developers should keep the following techniques in mind when designing applications.
旨在对动态应用程序执行锁分析,以便突出具有可能影响性能的锁争用的线程。
Designed to perform lock analysis on a live application in order to highlight threads with lock contention that could affect performance. This tool consists of two packages.
对于 WidgetCo,太多的应用程序在没有考虑负载均衡的情况下放在了单个服务器上,这些应用程序彼此争用服务器资源。
With WidgetCo, too many applications have been improperly balanced on a single server, and those applications fight for server resources.
通过分析工具并发方法,可以从多线程应用程序收集资源争用数据以及线程和进程活动数据。
The Profiling Tools concurrency method enables you to collect resource contention and thread and process activity data from multithreaded applications.
应用推荐