-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Jerry,
On 8/14/19 23:44, Jerry Malcolm wrote: > I was able to use a global resource and put a <ResourceLink> in > the default context file for each host. That will work, but you will have to restart Tomcat to make any changes to the <Resource>. It's not a great solution. The same was true for using global context.xml as well. The best option is to put everything in each application's private context.xml file if you can pull it off. Back to your math: > However, I don't think I want a different datasource for every web > app. Each webapp could need, say, 100 concurrent connections at > any one instant. But if there are 10 web apps, if I set all 10 to > have a max of 100 in order to handle the worst case scenario, then > I'll need to have at least 1000 connections available on the > database. Your math is correct: even a small number of per-application connections can add up to many total. But do you really want one application to starve another of connections? You might have per-client applications, and if one client uses lots of connections, the other clients will suffer stalls. (Ignoring database performance issues which are certainly present regardless of the details of connection-allocation.) Just remember that you will have to restart ALL of the applications in the JVM in order to make a change to the global <Resource>. If you specify the configuration in an app-private context.xml, you can bounce the one application to get the new configuration. > One last question... is there a way to determine the high-water > mark for the most active connections at any one instant? And along > with that, the max number of requests waiting at any one point if > all connections are in use? If I have way over-allocated maxTotal, > I'd like to know that. And likewise, if I've under-allocated > maxTotal and often have a bunch of requests waiting, I'd like to > know that as well. Is there a way to track that? I looked at the > MBean data in JConsole, and nothing obvious jumped out at me. Tomcat doesn't have anything built-in for this: you'll need some external tools. Have a look at this one: https://github.com/ChristopherSchultz/apache-tomcat-stuff/tree/master/bi n/nagios This is the tool I use to monitor various things through the jmxproxy. It's a Perl script that connects and pulls various data. It can append to a file if you use the "--append" argument with a filename. (I see that it's not documented... time to fix that!). Like this: jmxproxy --append /file/to/append And you'll get a file that looks like this after a while: 2019-08-16 00:08:23 112 2019-08-16 00:13:23 113 2019-08-16 00:18:23 108 2019-08-16 00:23:23 114 2019-08-16 00:28:23 114 I really should fix that so it prints out in proper ISO-8601 date format including 'T' and time zone indicator, but I haven't done it. :) Anyhow, if you use that, you can observe your data over time, and graphing the data will show high-water marks quite obviously. Hope that helps, - -chris -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl1WMbsACgkQHPApP6U8 pFhQxg/9Edk4PCFOeMliwHLLxaTel16b/YxWW533iy8sdbISq87pzNTJI0cUAJoE jfZ+WXsCId5bZyDDXIDnlNDHgGeQk4zhfRM3exJZCoVgr9pkqyd2ruS4WserPc1f UIMpWnm+ibLvrgzgI+bkzGU/tpwMnAyukf1wrVPPtJFoUpEH/9mGuqmEv0gDlBiE byg7UyPMJZSjhSpJuOVh2opoqOrKYyT0rA/sy4i/C4Jo3CVDfqmGQlOF66ApXRJB r7LCvTkYdS0fG04twt44tvd7QOEVbqnR7HAuHqUW+lZUhQ5nLB8bRoKLiwmTHTvO 3WfysxcLzVxfOIZvooVsp8dURiM9fYc/wY/APSkg8fxFcMPVRxxTjl0E/enjXXWj 6uhr7mtzRvcEnejXjxX85Xnq77BDHRYyMwPjVjpyRwrEUEShg4BYfLVRAoPVoFAQ A2OqMJKvipOwPQ03WPz7TBW5FiO3nljyvJqoWGic7c0X5ROZuSoLQ/ywu/XX0sg4 iORSFHV2buHyNZr6qVOAg3ZYuqKJbYgkboeyl16JNYEVJMv0DVok3TgsxUHzF3CY SmfTkEzwUGxTJ2POHwYd8CP/BgOm5+tnJOBi/8DoS9e5AC2dWue4SbZNSrvKJbnu sgTfgF8kbt9TClYpukIlXXdkz9SSi1hfhDxDMcW4Jhuv5ge7Rok= =JjYW -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org