we are using the predictive gouverner to limit resources for web app's.
i don't know much about db2 v8.1 on solaris but on db2 for z/os there is a table called sysibm.dsnrlst01 where u can define warning and erroe level's depending on the caculated service units wich were determined during the prepare statement. we have coded ur app's to be able to react on the maybe upcomming sqlcode +495 (warning limt reached and statement execution only if the user want to) and the sqlcode -495 (error limit reached and no execution). u can also define limits for reactive gouverner.
hope this help a bit.
Originally posted by gandalf_me
I have a java web application and a java engine running simultaneously, accessing same DB. I want to limit the usage of the engine process so that web users get reasonable performance.
If I want to share resources between web app and engine as 30:70,
how can I do that?
- Would giving web app connection high priority is the only option?
That would require us to change the application code (which is huge). What I am looking for is an external way to control over the resources (e.g. some settings for db2 governor).
The settings in db2 governor configuration files are absolute - absolute cpu time that can be taken by an application, absolute idle/uow time. There is no way to specify that resources can be shared among different applications/users in a given ratio. (unlike Database Resource Manager for Oracle where percentages of resources consumed by applications/users can be specified).
Also, I am not sure if the magnitude of difference in priorities of two different applications/processes makes any difference. E.g. Consider two cases
- one in which two processes have a priorities of 1 and 10
- another in which they have priorities of 5 and 6 respectively.
My understanding is that in both cases, *second* process (having higher priority) would get majority of resources. The fact that its priority in second case is *marginally* higher than priority of the first process makes no difference in resource allocation. (I may as well be wrong here).
So, what I want is to specify resource sharing in a relative way.
The problem here is going to be that, no matter what the "priorities" of the respective tasks might be, the (only!!) thing that's going to affect their impact on the system .. on the performance experienced by the web users .. is going to be: the scope of what the background task is doing [i]to the database.[/b] The number of records it affects, the size and frequency of the locks that it creates ... not the execution priority assigned to the background process by the operating system's scheduler!
(In fact, if the background task isn't given good priority it might simply wait longer, and delay things more.)
To be a "good citizen" alongside web-oriented activity, the background task must lock small areas of the database, hold them briefly. In other words, exhibit a performance footprint similar to that of the web-oriented activities.
(A slow, unobtrusive car that's in the fast-lane isn't unobtrusive... it's just holding up traffic.)
After reading this post, first thing that came to my mind was "database resource manager (DRM)" of oracle (first introduced in 8i and got better in 9i). But for db2, here's the thought...
Sessions run with no prioritization can create problems where unwanted sessions taking away most of the CPU, memory and disk space.
As Marc suggested -- db2 governor can be used (if possible) and further in order to make resource sharing in a relative way -- you need to create plan, resources, create groups, assign users to groups etc In other words, one can write a package or utility that assigns resources according to the resource mgmt plan. for eg: x% of resources to Group1 during the day, y% to other group and remaining to group3 etc.