Kaui: evaluate enabling JRuby invokedynamic (setenv.sh hard-codes -Djruby.compile.invokedynamic=false)
@tungleduyxyz đang làm issue này rồi.
Từ ngày 4/11/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Summary
The shared Tomcat setenv.sh template turns JRuby's invokedynamic support off for every image built from it, Kaui included. A JRuby performance team recommends turning it on:
Method profiles end up being heavily polluted by non-indy method call logic, including some places that appear to be polymorphic and could benefit from the indy logic's polymorphic cache. [...] it will improve the quality of the profiles and it should perform better (if it does not then that's what we need to investigate, because it blows non-indy away on smaller stuff).
Where
ansible/templates/tomcat/conf/setenv.sh.j2#L35 (same line on master and java2x):
-Djruby.compile.invokedynamic=false
- The base image is shared by the Kill Bill and Kaui images. The setting was probably added for Kill Bill's JRuby plugins; it isn't documented why.
- It is present on the Java 21 / Tomcat 11 perf server, running Kill Bill 0.25.5 + Kaui 4.0.26 / JRuby 10.0.6.0 (checked on the running JVM's command line).
- Kaui can override it without touching Kill Bill:
ansible/templates/kaui/conf/setenv2.sh.j2appends{{ kaui_system_properties }}toCATALINA_OPTSaftersetenv.sh, and for a repeated-Dthe JVM uses the last value.
Relationship with the JIT login bug
The Kaui login bug (killbill/killbill-admin-ui-standalone#131) happens with invokedynamic on and off. It is a JIT bug in JRuby 10.0.x, fixed in 10.1.1.0+ (see killbill/killbill-admin-ui-standalone#133). So enabling indy is not blocked by it, as long as the current workaround (-Djruby.jit.exclude=Rails::Engine#call, killbill/killbill-cloud#346) or JRuby 10.1.1+ is in place.
Plan
- Experiment on the perf server, Kaui only: add
-Djruby.compile.invokedynamic=true(keeping thejit.excludeworkaround). - Run the same Gatling scenarios as the baseline (killbill-admin-ui-standalone
perf/, 10 users, 600 s), after warm-up: indy usually costs more at startup/warm-up and pays off once warm. Capture JFR for each run. - Compare with the baseline below. Check method profiles (less call-site overhead), allocation, p75/p95/p99, and warm-up time.
- If it's better, change the default for the Kaui image only (via
kaui_system_propertiesor the Kauisetenv2.sh.j2). Kill Bill's setting stays as is unless the Kill Bill team wants to evaluate it too.
Baseline (indy off, G1, shared Kill Bill + Kaui JVM on a t2.medium):
| Scenario | p75 | p95 | p99 |
|---|---|---|---|
| realistic mix | 1,097 ms | 1,978 ms | — |
account_show |
— | 331 ms | — |
timeline |
292 ms | 1,601 ms | 2,533 ms |
Acceptance criteria
- Before/after Gatling results and JFR recordings with indy on vs off (same instance, same data, after warm-up)
- Decision recorded; if positive, the Kaui image/role defaults to
-Djruby.compile.invokedynamic=true, and the reason for keeping (or changing) Kill Bill's setting is documented insetenv.sh.j2
Related
- killbill/killbill-admin-ui-standalone#131 / #133: JIT login bug and the JRuby 10.1 upgrade
- killbill/killbill-cloud#346: the
jit.excludeworkaround - killbill/killbill-cloud#344: Tomcat 11 / JDK 21
- killbill/killbill-client-ruby#125, #126 and killbill/killbill-admin-ui-standalone#136: the other items from the same profiling round
- Ngôn ngữ chính
- Ruby
- Star
- 68
- Fork
- 93
- Merge trung bình
- 1 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của killbill/killbill-cloud
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
killbill/killbill-cloud#265 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
killbill/killbill-cloud#351 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 50/100
killbill/killbill-cloud#302 ·
-
Support for Maven CentralCó thể làm lại được @tungleduyxyz đã nhận 436 ngày trước và không có pull request nào đang mở. Đang mở
killbill/killbill-cloud#291 · 1 người được giao ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
killbill/killbill-cloud#283 · 1 bình luận ·
Tất cả issue của killbill/killbill-cloud
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
-
Docker images: plain X.Y.Z tag (e.g. 7.2.3) is never updated after the initial release buildĐang mởneeds verification
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 13 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
palladius/rails8-app-on-gcp#244 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
MAC addresses issuesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
rezoleo/lea5#583 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày