Metrics refresh full-scans okapi_outbox (COUNT(*) GROUP BY status incl. 7 days of DELIVERED) every 15s per instance
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 42/100
- Tipo de issue
- Refatoração
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- kotlin, mysql, postgresql
- Domínio
- databases, observability
Direção de pesquisa
Start in MicrometerOutboxMetrics, where the refresh runs the two queries, and in OutboxStore.countByStatuses and findOldestCreatedAt, which hold the GROUP BY status SQL. Decide which statuses the metrics need, then rewrite the oldest-per-status lookup as an index-ordered LIMIT 1 query per status. Done when the queries no longer scan DELIVERED rows and the metrics tests still pass on both PostgreSQL and MySQL.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Severity: Medium (performance) · Area: okapi-micrometer MicrometerOutboxMetrics, OutboxStore.countByStatuses/findOldestCreatedAt · Found in: code review of main @ e5630a1
Problem
Every metrics refresh runs two queries per instance, every 15 s by default:
SELECT status, COUNT(*) FROM okapi_outbox GROUP BY status;
SELECT status, MIN(created_at) FROM okapi_outbox WHERE status IN (?,?,?) GROUP BY status;
COUNT(*) ... GROUP BY statushas to visit every row. The table keeps 7 days ofDELIVEREDrows by default (purger retention), which is ~60 M rows at 100 msg/s. N application instances each run this full scan every 15 s.- The
MIN(created_at)query is index-friendly on MySQL (loose index scan), but Postgres before v18 has no skip scan.GROUP BY statuswithINcan scan the whole(status, created_at)index, again dominated byDELIVEREDrows nobody alerts on.
Load grows with retention × throughput × instance count, on the same primary that serves the application's writes.
Suggested fix
- Restrict both queries to the statuses that matter operationally (
PENDING,FAILED).DELIVEREDcount/lag is rarely useful, and when it is, it can come from the counters. - Compute oldest-per-status with per-status index-ordered lookups, e.g.
(SELECT created_at FROM okapi_outbox WHERE status='PENDING' ORDER BY created_at LIMIT 1), which costs O(log n) on both databases. - Optionally report
DELIVEREDfrom planner estimates or drop it.
- Linguagem predominante
- Kotlin
- Estrelas
- 14
- Forks
- 0
- Merge médio
- 9h 54min
- PRs com merge (30d)
- 11
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de softwaremill/okapi
-
bug
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
softwaremill/okapi#141 ·
Mantenedores costumam responder em até 1 dia
-
OutboxProcessorListener events are emitted before the transaction commits; metrics over-count on commit failureTalvez já em andamento @rawo assumiu hoje. Abertabreaking-change bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
softwaremill/okapi#137 ·
Mantenedores costumam responder em até 1 dia
-
breaking-change bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
softwaremill/okapi#135 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 3/5 Meio dia Facilidade para iniciantes 62/100
softwaremill/okapi#134 ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 22/100
softwaremill/okapi#133 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de softwaremill/okapi
Issues semelhantes
-
bug javascript
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia
-
Source: c7 Type: bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
-
2.23
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
ankidroid/Anki-Android#23042 · 4 comentários ·
Mantenedores costumam responder em até 1 dia
-
[Submission] AI通话助手Abertasubmit-adaption submit-adaption-pre
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
BetterAndroid/android-notification-icon-project#828 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
ProdigyV21/ARVIO#874 ·
Mantenedores costumam responder em até 1 dia