lhotari commented on PR #24623:
URL: https://github.com/apache/pulsar/pull/24623#issuecomment-3210050682

   I have updated the test to be more realistic. There's now a way to simulate 
that the cached entries are 8kB of size. I added a required internal interface 
`EntryLengthFunction` and integration in the `PulsarTestContext` framework to 
support this. 
   The test now tests with 10 topic partitions, producer throughput of 
50000msg/s and with 250MB cache size. 
   PIP430 implementation is again superior to others, with the cache hit 
percentage of 98.4%. It turns out that the previous default cache strategy 
(76.85%) beats cacheEvictionByMarkDeletedPosition (59.97%) and PR12258 (52.09%) 
when the cache size is the main constraint.
   
   ```shell
   ❯ ENABLE_MANUAL_TEST=true NETTY_LEAK_DETECTION=off mvn -pl pulsar-broker 
test -Dtest=BrokerEntryCacheRollingRestartTest
   ...
   { cat pulsar-broker/target/rolling_restarts_result_header.txt; cat 
pulsar-broker/target/rolling_restarts_result_*.csv } | duckdb -markdown -c 
"select description, round(avg(hits), 2), round(avg(misses),2), avg(produced), 
avg(consumed), avg(bk_reads), avg(bk_read_entries) from read_csv('/dev/stdin') 
group by description order by 3"
   ```
   
   |            description             | round(avg(hits), 2) | 
round(avg(misses), 2) | avg(produced) | avg(consumed) | avg(bk_reads) | 
avg(bk_read_entries) |
   
|------------------------------------|--------------------:|----------------------:|--------------:|--------------:|--------------:|---------------------:|
   | PIP430                             | 98.6                | 1.4             
      | 1549271.0     | 15504486.2    | 2351.0        | 216622.0             |
   | PIP430disabled                     | 76.85               | 23.15           
      | 1549220.8     | 15515415.4    | 60024.2       | 3592180.0            |
   | cacheEvictionByMarkDeletedPosition | 59.97               | 40.03           
      | 1548167.6     | 15514712.0    | 78794.2       | 6208959.4            |
   | PR12258                            | 52.09               | 47.91           
      | 1518004.4     | 15213489.2    | 76129.4       | 7280525.8            |
   
   details:
   ```shell
   ❯ { cat pulsar-broker/target/rolling_restarts_result_header.txt; cat 
pulsar-broker/target/rolling_restarts_result_*.csv } | duckdb -markdown -c 
"select * from read_csv('/dev/stdin') "
   ```
   
   |            description             | produced | consumed | consumers | 
bk_reads | bk_read_entries | hits  | misses | restarts |           ts           
 |
   
|------------------------------------|---------:|---------:|----------:|---------:|----------------:|------:|-------:|---------:|-------------------------|
   | PR12258                            | 1532416  | 15361949 | 10        | 
66934    | 6394537         | 58.37 | 41.63  | 3        | 2025-08-21 
10:37:53.371 |
   | PR12258                            | 1549702  | 15531430 | 10        | 
71797    | 6764940         | 56.44 | 43.56  | 3        | 2025-08-21 
10:38:26.935 |
   | PR12258                            | 1528875  | 15308816 | 10        | 
80130    | 7702434         | 49.69 | 50.31  | 3        | 2025-08-21 
10:39:00.267 |
   | PR12258                            | 1505071  | 15088036 | 10        | 
84316    | 8105838         | 46.28 | 53.72  | 3        | 2025-08-21 
10:39:33.859 |
   | PR12258                            | 1473958  | 14777215 | 10        | 
77470    | 7434880         | 49.69 | 50.31  | 3        | 2025-08-21 
10:40:08.021 |
   | cacheEvictionByMarkDeletedPosition | 1544173  | 15475687 | 10        | 
120594   | 9723958         | 37.17 | 62.83  | 3        | 2025-08-21 
10:40:50.853 |
   | cacheEvictionByMarkDeletedPosition | 1549344  | 15526299 | 10        | 
79955    | 6216643         | 59.96 | 40.04  | 3        | 2025-08-21 
10:41:23.889 |
   | cacheEvictionByMarkDeletedPosition | 1549034  | 15523969 | 10        | 
59132    | 4410078         | 71.59 | 28.41  | 3        | 2025-08-21 
10:41:56.936 |
   | cacheEvictionByMarkDeletedPosition | 1548770  | 15520337 | 10        | 
69089    | 5418665         | 65.09 | 34.91  | 3        | 2025-08-21 
10:42:30.026 |
   | cacheEvictionByMarkDeletedPosition | 1549517  | 15527268 | 10        | 
65201    | 5275453         | 66.02 | 33.98  | 3        | 2025-08-21 
10:43:03.221 |
   | PIP430disabled                     | 1549267  | 15520017 | 10        | 
187155   | 10236574        | 34.04 | 65.96  | 3        | 2025-08-21 
10:43:46.284 |
   | PIP430disabled                     | 1549413  | 15511496 | 10        | 
23154    | 1573744         | 89.85 | 10.15  | 3        | 2025-08-21 
10:44:19.389 |
   | PIP430disabled                     | 1549397  | 15507742 | 10        | 
39678    | 2336104         | 84.94 | 15.06  | 3        | 2025-08-21 
10:44:52.413 |
   | PIP430disabled                     | 1548853  | 15515587 | 10        | 
19009    | 1490084         | 90.4  | 9.6    | 3        | 2025-08-21 
10:45:25.498 |
   | PIP430disabled                     | 1549174  | 15522235 | 10        | 
31125    | 2324394         | 85.03 | 14.97  | 3        | 2025-08-21 
10:45:58.584 |
   | PIP430                             | 1549565  | 15507910 | 10        | 
1113     | 99113           | 99.36 | 0.64   | 3        | 2025-08-21 
10:46:41.442 |
   | PIP430                             | 1549340  | 15501783 | 10        | 
2674     | 247181          | 98.41 | 1.59   | 3        | 2025-08-21 
10:47:14.526 |
   | PIP430                             | 1549189  | 15501577 | 10        | 
2349     | 212708          | 98.63 | 1.37   | 3        | 2025-08-21 
10:47:47.508 |
   | PIP430                             | 1549287  | 15501902 | 10        | 
2750     | 256654          | 98.34 | 1.66   | 3        | 2025-08-21 
10:48:20.539 |
   | PIP430                             | 1548974  | 15509259 | 10        | 
2869     | 267454          | 98.28 | 1.72   | 3        | 2025-08-21 
10:48:53.543 |
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to