<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          buffer-slayer持久層吞吐量優(yōu)化組件

          聯(lián)合創(chuàng)作 · 2023-10-01 21:47

          buffer-slayer 是一個把請求在內(nèi)存中 buffer 并批量發(fā)送的工具,適用于批量能顯著提升性能的組件(redis-client、jdbc), 支持一對一的回調(diào)。

          快速啟動

          
            
            
             
              io.bufferslayer
             
            
             
              buffer-spring-jdbc
             
            
             
              1.1.0
             
          
            
          ReporterProperties reporterProperties = new ReporterProperties()
                  .setBufferedMaxMessages(500)
                  .setPendingMaxMessages(10000)
                  .setMetrics("inmemory")
                  .setMetricsExporter("http")
                  .setParallelismPerBatch(5)
                  .setSenderExecutor(new ThreadPoolExecutor(200,
                      200, 0, TimeUnit.MILLISECONDS, new SynchronousQueue()));
          
          BatchedJdbcTemplate template = new BatchedJdbcTemplate(reporterProperties);
          template.setDataSource(dataSource);
          
          Promise promise = template.update(...);
          promise.done(success -> ...)
                 .fail(reject -> ...);

          吞吐量對比

          Benchmark                                                      Mode  Cnt       Score  Units
          BatchedJdbcTemplateBenchmark.high_contention_batched          thrpt   15    8709.042  ops/s
          BatchedJdbcTemplateBenchmark.high_contention_unbatched        thrpt   15     271.529  ops/s
          BatchedJdbcTemplateBenchmark.mild_contention_batched          thrpt   15    2146.595  ops/s
          BatchedJdbcTemplateBenchmark.mild_contention_unbatched        thrpt   15     262.621  ops/s
          BatchedJdbcTemplateBenchmark.no_contention_batched            thrpt   15    1194.852  ops/s
          BatchedJdbcTemplateBenchmark.no_contention_unbatched          thrpt   15     201.806  ops/s

           

          瀏覽 22
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  操逼在线播放 | 欧美色图亚洲图片插菊花综合 | 天天日批 | 午夜精品久久久久久久免费APP | 国产肏屄网站 |