{"id":14242,"date":"2013-06-17T19:00:20","date_gmt":"2013-06-17T16:00:20","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=14242"},"modified":"2013-06-17T01:46:35","modified_gmt":"2013-06-16T22:46:35","slug":"how-many-threads-does-it-take-to-fill-a-pool","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2013\/06\/how-many-threads-does-it-take-to-fill-a-pool.html","title":{"rendered":"How Many Threads Does It Take to Fill a Pool?"},"content":{"rendered":"<p>In recent months we have been seeing a small but persistent percentage of our operations fail with a strange exception \u2013 org.springframework.jdbc.CannotGetJdbcConnectionException\u00a0 \u2013 \u201cCould not get JDBC Connection; nested exception is java.sql.SQLException: An attempt by a client to checkout a Connection has timed out<a href=\"https:\/\/rpm.newrelic.com\/accounts\/23428\/applications\/248223\/traced_errors\/550246779\">.<\/a>\u201d<\/p>\n<p>Our natural assumption was that we have some sort of contention on our C3P0 connection pool, where clients trying to acquire a connection have to wait for one to be available. Our best guess was that it is this contention that causes the timeouts.<\/p>\n<p>So of course, the first thing we did was increase the max number of connections in the connection pool. However, no matter how high we set the limit, it did not help. Then we tried changing the timeout parameters of the connection. That did not produce any better results.<\/p>\n<p>At this point intelligence settled in, and since guessing did not seem to work, we decided to measure. Using a simple wrapper on the connection pool, we saw that even when we have free connections in the connection pool, we still get checkout timeouts.<\/p>\n<h2>Investigating Connection Pool Overhead<\/h2>\n<p>To investigate connection pool overhead we performed a benchmark consisting of 6 rounds, each including 20,000 SQL operations (with a read\/write ratio of 1:10), performed using 20 threads with a connection pool of 20 connections. Having 20 threads using a pool with 20 connections means there is no contention on the resources (the connections). Therefore any overhead is caused by the connection pool itself.<\/p>\n<p>We disregarded results from the first (warm-up) run, taking the statistics from the subsequent 5 runs. From these data we gather the connection checkout time, connection release time and total pool overhead.<\/p>\n<p>The benchmark project code can be found at: <a href=\"https:\/\/github.com\/yoavaa\/connection-pool-benchmark\">https:\/\/github.com\/yoavaa\/connection-pool-benchmark<\/a><\/p>\n<p>We tested 3 different connection pools:<\/p>\n<ul>\n<li>C3P0 \u2013 com.mchange:c3p0:0.9.5-pre3 \u2013 class C3P0DataSourceBenchmark<\/li>\n<li>Bone CP \u2013 com.jolbox:bonecp:0.8.0-rc1 \u2013 class BoneDataSourceBenchmark<\/li>\n<li>Apache DBCP \u2013 commons-dbcp:commons-dbcp:1.4 \u2013 class DbcpDataSourceBenchmark<\/li>\n<\/ul>\n<p>(In the project there is another benchmark of my own experimental async pool \u2013 <a href=\"https:\/\/github.com\/yoavaa\/async-connection-pool\">https:\/\/github.com\/yoavaa\/async-connection-pool<\/a>. However, for the purpose of this post, I am going to ignore it).<\/p>\n<p>In order to run the benchmark yourself, you should setup MySQL with the following table<\/p>\n<pre class=\" brush:bash\">CREATE TABLE item (\r\n  file_name\u00a0\u00a0 \u00a0 varchar(100) NOT NULL,\r\n  user_guid\u00a0\u00a0 \u00a0 varchar(50) NOT NULL,\r\n  media_type \u00a0\u00a0 varchar(16) NOT NULL,\r\n  date_created\u00a0 datetime NOT NULL,\r\n  date_updated\u00a0 timestamp AUTO_INCREMENT NOT NULL DEFAULT CURRENT_TIMESTAMP,\r\n  PRIMARY KEY(file_name)\r\n)<\/pre>\n<p>Then update the Credentials object to point at this MySQL installation.<\/p>\n<p>When running the benchmarks, a sample result would look like this:<\/p>\n<pre class=\" brush:bash\">run, param, total time, errors, under 1000 nSec,1000 nSec - 3200 nSec,3200 nSec - 10 \u00b5Sec,10 \u00b5Sec - 32 \u00b5Sec,32 \u00b5Sec - 100 \u00b5Sec,100 \u00b5Sec - 320 \u00b5Sec,320 \u00b5Sec - 1000 \u00b5Sec,1000 \u00b5Sec - 3200 \u00b5Sec,3200 \u00b5Sec - 10 mSec,10 mSec - 32 mSec,32 mSec - 100 mSec,100 mSec - 320 mSec,320 mSec - 1000 mSec,1000 mSec - 3200 mSec,other\r\n0, acquire,29587,0,0,5,1625,8132,738,660,1332,1787,2062,2048,1430,181,0,0,0\r\n0, execution, , ,0,0,0,0,0,0,0,1848,6566,6456,5078,52,0,0,0\r\n0, release, , ,0,8,6416,9848,3110,68,77,115,124,148,75,11,0,0,0\r\n0, overhead, , ,0,0,49,4573,5459,711,1399,1812,2142,2157,1498,200,0,0,0\r\n1, acquire,27941,0,0,125,8153,499,658,829,1588,2255,2470,2377,1013,33,0,0,0\r\n1, execution, , ,0,0,0,0,0,0,6,1730,6105,6768,5368,23,0,0,0\r\n1, release, , ,0,49,15722,3733,55,42,69,91,123,101,14,1,0,0,0\r\n1, overhead, , ,0,0,2497,5819,869,830,1610,2303,2545,2448,1042,37,0,0,0<\/pre>\n<p>This information was imported into an Excel file (also included in the benchmark project) for analysis.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h2>C3P0<\/h2>\n<p>It is with C3P0 that we originally saw the original exception in our production environment. Let\u2019s see how it performs:<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/06\/c3p0-1.jpg\" rel=\"attachment wp-att-507\"><img decoding=\"async\" class=\"aligncenter\" alt=\"\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/06\/c3p0-1.jpg\" width=\"480\" height=\"288\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/06\/c3p0-2.jpg\" rel=\"attachment wp-att-506\"><img decoding=\"async\" class=\"aligncenter\" alt=\"\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/06\/c3p0-2.jpg\" width=\"481\" height=\"288\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/06\/c3p0-3.jpg\" rel=\"attachment wp-att-505\"><img decoding=\"async\" class=\"aligncenter\" alt=\"\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/06\/c3p0-3.jpg\" width=\"481\" height=\"289\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/06\/c3p0-4.jpg\" rel=\"attachment wp-att-504\"><img decoding=\"async\" class=\"aligncenter\" alt=\"\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/06\/c3p0-4.jpg\" width=\"482\" height=\"290\" \/><\/a><\/p>\n<p><i>Reading the charts:<\/i><\/p>\n<p><i>The first three charts (acquire, release, overhead) are bucket charts based on performance. The Y-axis indicates the number of operations that completed within a certain time range (shown on the X-axis). The default rule of thumb here is that the higher the bars to the left, the better. The 4<sup>th<\/sup> chart is a waterfall chart, where each horizontal line indicates one DB operation. Brown indicates time waiting to acquire a connection, green is time to execute the DB operation, blue indicates time to return a connection to the connection pool.<\/i><\/p>\n<p>Looking at the charts, we see that generally, C3P0 acquires a connection within 3.2-10 microseconds and releases connections within 3.2-10 microseconds. That is definitely some impressive performance. However, C3P0 has also another peak at about 3.2-32 milliseconds, as well as a long tail getting as high as 320 \u2013 1000 milliseconds. It is this second peak that causes our exceptions.<\/p>\n<p>What\u2019s going on with C3P0? What causes this small but significant percentage of extremely long operations, while most of the time performance is pretty amazing? Looking at the 4<sup>th<\/sup> chart can point us in the direction of the answer.<\/p>\n<p>The 4<sup>th<\/sup> chart has a clear diagonal line from top left to bottom right, indicating that overall, connection acquisition is starting in sequence. But we can identify something strange \u2013 we can see brown triangles, indicating cases where when multiple threads try to acquire a connection, the first thread waits more time than subsequent threads. This translates to two performance \u2018groups\u2019 for acquiring a connection. Some threads get a connection extremely quickly, whereas some reach starvation waiting for a connection while latecomer threads\u2019 requests are answered earlier.<\/p>\n<p>Such a behavior, where an early thread waits longer than a subsequent thread, means unfair synchronization. Indeed, when digging into C3P0 code, we have seen that during the acquisition of a connection, C3P0 uses the \u2018<i>synchronized<\/i>\u2019 keyword three times. In Java the \u2018<i>synchronized<\/i>\u2019 keyword creates an unfair lock, which can cause thread starvation.<\/p>\n<p>We may try patching C3P0 with fair locks later on. If we do so, we will naturally share our findings.<\/p>\n<p>The C3P0 configuration for this benchmark:<\/p>\n<ul>\n<li>Minimum pool size: 20<\/li>\n<li>Initial pool size: 20<\/li>\n<li>Maximum pool size: 20<\/li>\n<li>Acquire increment: 10<\/li>\n<li>Number of helper threads: 6<\/li>\n<\/ul>\n<h2>BoneCP<\/h2>\n<p>We have tried BoneCP at Wix with mixed results, so that at the moment we are not sure if we like it. We include the results of the BoneCP benchmarks in these posts, though the analysis is not as comprehensive.<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/06\/bone-1.jpg\" rel=\"attachment wp-att-511\"><img decoding=\"async\" class=\"aligncenter\" alt=\"\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/06\/bone-1.jpg\" width=\"481\" height=\"289\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/06\/bone-2.jpg\" rel=\"attachment wp-att-510\"><img decoding=\"async\" class=\"aligncenter\" alt=\"\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/06\/bone-2.jpg\" width=\"482\" height=\"289\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/06\/bone-3.jpg\" rel=\"attachment wp-att-509\"><img decoding=\"async\" class=\"aligncenter\" alt=\"\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/06\/bone-3.jpg\" width=\"481\" height=\"291\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/06\/bone-41.jpg\" rel=\"attachment wp-att-516\"><img decoding=\"async\" class=\"aligncenter\" alt=\"\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/06\/bone-41.jpg\" width=\"482\" height=\"291\" \/><\/a><\/p>\n<p>Looking at the charts, we can see that Bone\u2019s connection acquisition performance is outstanding \u2013 most the operations are completed within 3.2 microseconds, much faster than C3P0. However, we also observe that the connection release time is significant, about 1-10 milliseconds, way too high. We also observe that Bone has a long tail of operations with overhead getting as high as 320 milliseconds.<\/p>\n<p>Looking at the data, it appears BoneCP is better compared to C3P0 \u2013 both in the normal and \u2018extreme\u2019 cases. However, the difference is not large, as is evidenced by the charts. Looking at the 4<sup>th<\/sup> chart, we see we have less brown compared to C3P0 (since connection acquisition is better) but trailing blue lines have appeared, indicating the periods of time that threads wait for a connection to be released.<\/p>\n<p>As mentioned above, since we are ambivalent at best about using BoneCP, We have not invested significant resources in analyzing this connection pools\u2019 performance issues.<\/p>\n<h2>Apache DBCP<\/h2>\n<p>Apache DBCP is known as the Old Faithful of datasources. Let\u2019s see how it fares compared to the other two.<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/06\/dbcp-1.jpg\" rel=\"attachment wp-att-515\"><img decoding=\"async\" class=\"aligncenter\" alt=\"\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/06\/dbcp-1.jpg\" width=\"481\" height=\"290\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/06\/dbcp-2.jpg\" rel=\"attachment wp-att-514\"><img decoding=\"async\" class=\"aligncenter\" alt=\"\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/06\/dbcp-2.jpg\" width=\"481\" height=\"289\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/06\/dbcp-3.jpg\" rel=\"attachment wp-att-513\"><img decoding=\"async\" class=\"aligncenter\" alt=\"\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/06\/dbcp-3.jpg\" width=\"480\" height=\"291\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/06\/dbcp-4.jpg\" rel=\"attachment wp-att-512\"><img decoding=\"async\" class=\"aligncenter\" alt=\"\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/06\/dbcp-4.jpg\" width=\"482\" height=\"292\" \/><\/a><\/p>\n<p>One thing is evident \u2013 DBCP performance is superior to both C3P0 and Bone. In all regards, it outperforms the other alternatives, whether in terms of connection checkout times, connection release time and in the form of the waterfall chart.<\/p>\n<h2>So What Datasource Should You Be Using?<\/h2>\n<p>Well, that is a non-trivial question. It is clear that with regards to connection pool performance, we have a clear winner \u2013 DBCP. It also seems that C3P0 should be easy to fix, and we may just try that.<\/p>\n<p>However, it is important to remember that the scope of this investigation was limited only to the performance of the actual connection acquisition\/release. Actual datasource selection is a more complex issue. This benchmark for example, ignores some important aspects, such as growth and shrinkage of the pool, handling of network errors, handling failover in case of DB failure and more.<br \/>\n&nbsp;<\/p>\n<div style=\"border: 1px solid #D8D8D8; background: #FAFAFA; width: 100%; padding-left: 5px;\"><b><i>Reference: <\/i><\/b><a href=\"http:\/\/wix.io\/2013\/06\/12\/how-many-threads-does-it-take-to-fill-a-pool\/\">How Many Threads Does It Take to Fill a Pool?<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/jcg\">JCG partner<\/a> Yoav Abrahami at the <a href=\"http:\/\/wix.io\/\">Wix IO<\/a> blog.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In recent months we have been seeing a small but persistent percentage of our operations fail with a strange exception \u2013 org.springframework.jdbc.CannotGetJdbcConnectionException\u00a0 \u2013 \u201cCould not get JDBC Connection; nested exception is java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.\u201d Our natural assumption was that we have some sort of contention &hellip;<\/p>\n","protected":false},"author":331,"featured_media":112,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[380],"class_list":["post-14242","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-threads"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How Many Threads Does It Take to Fill a Pool?<\/title>\n<meta name=\"description\" content=\"In recent months we have been seeing a small but persistent percentage of our operations fail with a strange exception \u2013\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2013\/06\/how-many-threads-does-it-take-to-fill-a-pool.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How Many Threads Does It Take to Fill a Pool?\" \/>\n<meta property=\"og:description\" content=\"In recent months we have been seeing a small but persistent percentage of our operations fail with a strange exception \u2013\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2013\/06\/how-many-threads-does-it-take-to-fill-a-pool.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2013-06-17T16:00:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Yoav Abrahami\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Yoav Abrahami\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/06\\\/how-many-threads-does-it-take-to-fill-a-pool.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/06\\\/how-many-threads-does-it-take-to-fill-a-pool.html\"},\"author\":{\"name\":\"Yoav Abrahami\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/63dede64803b9dca8418703b1b978cb2\"},\"headline\":\"How Many Threads Does It Take to Fill a Pool?\",\"datePublished\":\"2013-06-17T16:00:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/06\\\/how-many-threads-does-it-take-to-fill-a-pool.html\"},\"wordCount\":1209,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/06\\\/how-many-threads-does-it-take-to-fill-a-pool.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"keywords\":[\"Threads\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/06\\\/how-many-threads-does-it-take-to-fill-a-pool.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/06\\\/how-many-threads-does-it-take-to-fill-a-pool.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/06\\\/how-many-threads-does-it-take-to-fill-a-pool.html\",\"name\":\"How Many Threads Does It Take to Fill a Pool?\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/06\\\/how-many-threads-does-it-take-to-fill-a-pool.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/06\\\/how-many-threads-does-it-take-to-fill-a-pool.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"datePublished\":\"2013-06-17T16:00:20+00:00\",\"description\":\"In recent months we have been seeing a small but persistent percentage of our operations fail with a strange exception \u2013\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/06\\\/how-many-threads-does-it-take-to-fill-a-pool.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/06\\\/how-many-threads-does-it-take-to-fill-a-pool.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/06\\\/how-many-threads-does-it-take-to-fill-a-pool.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"java-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/06\\\/how-many-threads-does-it-take-to-fill-a-pool.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"How Many Threads Does It Take to Fill a Pool?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/63dede64803b9dca8418703b1b978cb2\",\"name\":\"Yoav Abrahami\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/212ff65d59fa7dff9e9c8937ef613f252abc4744d064179c3cd52facdd8667ae?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/212ff65d59fa7dff9e9c8937ef613f252abc4744d064179c3cd52facdd8667ae?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/212ff65d59fa7dff9e9c8937ef613f252abc4744d064179c3cd52facdd8667ae?s=96&d=mm&r=g\",\"caption\":\"Yoav Abrahami\"},\"description\":\"Yoav is the Chief Architect at Wix.com, working with developers and operations to build the company's future products as well as accelerating and improving development processes. Prior to joining Wix, Yoav was an Architect at Amdocs Cramer OSS division. Yoav holds a MS in Physics and a BS in Computer Science from the Tel Aviv University.\",\"sameAs\":[\"http:\\\/\\\/wix.io\\\/\",\"http:\\\/\\\/il.linkedin.com\\\/in\\\/yoavabrahami\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/yoav-abrahami\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How Many Threads Does It Take to Fill a Pool?","description":"In recent months we have been seeing a small but persistent percentage of our operations fail with a strange exception \u2013","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2013\/06\/how-many-threads-does-it-take-to-fill-a-pool.html","og_locale":"en_US","og_type":"article","og_title":"How Many Threads Does It Take to Fill a Pool?","og_description":"In recent months we have been seeing a small but persistent percentage of our operations fail with a strange exception \u2013","og_url":"https:\/\/www.javacodegeeks.com\/2013\/06\/how-many-threads-does-it-take-to-fill-a-pool.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2013-06-17T16:00:20+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","type":"image\/jpeg"}],"author":"Yoav Abrahami","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Yoav Abrahami","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2013\/06\/how-many-threads-does-it-take-to-fill-a-pool.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/06\/how-many-threads-does-it-take-to-fill-a-pool.html"},"author":{"name":"Yoav Abrahami","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/63dede64803b9dca8418703b1b978cb2"},"headline":"How Many Threads Does It Take to Fill a Pool?","datePublished":"2013-06-17T16:00:20+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/06\/how-many-threads-does-it-take-to-fill-a-pool.html"},"wordCount":1209,"commentCount":4,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/06\/how-many-threads-does-it-take-to-fill-a-pool.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","keywords":["Threads"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2013\/06\/how-many-threads-does-it-take-to-fill-a-pool.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2013\/06\/how-many-threads-does-it-take-to-fill-a-pool.html","url":"https:\/\/www.javacodegeeks.com\/2013\/06\/how-many-threads-does-it-take-to-fill-a-pool.html","name":"How Many Threads Does It Take to Fill a Pool?","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/06\/how-many-threads-does-it-take-to-fill-a-pool.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/06\/how-many-threads-does-it-take-to-fill-a-pool.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","datePublished":"2013-06-17T16:00:20+00:00","description":"In recent months we have been seeing a small but persistent percentage of our operations fail with a strange exception \u2013","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/06\/how-many-threads-does-it-take-to-fill-a-pool.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2013\/06\/how-many-threads-does-it-take-to-fill-a-pool.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2013\/06\/how-many-threads-does-it-take-to-fill-a-pool.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","width":150,"height":150,"caption":"java-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2013\/06\/how-many-threads-does-it-take-to-fill-a-pool.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"How Many Threads Does It Take to Fill a Pool?"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/63dede64803b9dca8418703b1b978cb2","name":"Yoav Abrahami","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/212ff65d59fa7dff9e9c8937ef613f252abc4744d064179c3cd52facdd8667ae?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/212ff65d59fa7dff9e9c8937ef613f252abc4744d064179c3cd52facdd8667ae?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/212ff65d59fa7dff9e9c8937ef613f252abc4744d064179c3cd52facdd8667ae?s=96&d=mm&r=g","caption":"Yoav Abrahami"},"description":"Yoav is the Chief Architect at Wix.com, working with developers and operations to build the company's future products as well as accelerating and improving development processes. Prior to joining Wix, Yoav was an Architect at Amdocs Cramer OSS division. Yoav holds a MS in Physics and a BS in Computer Science from the Tel Aviv University.","sameAs":["http:\/\/wix.io\/","http:\/\/il.linkedin.com\/in\/yoavabrahami"],"url":"https:\/\/www.javacodegeeks.com\/author\/yoav-abrahami"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/14242","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/331"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=14242"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/14242\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/112"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=14242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=14242"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=14242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}