This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-20
Channels
- # aws (1)
- # babashka (68)
- # beginners (68)
- # braveandtrue (6)
- # calva (4)
- # cider (10)
- # clj-kondo (26)
- # clojure (76)
- # clojure-dev (18)
- # clojure-europe (1)
- # clojure-norway (25)
- # clojure-spec (8)
- # clojure-sweden (7)
- # clojure-uk (3)
- # clojuredesign-podcast (1)
- # clojurescript (11)
- # conjure (29)
- # cursive (31)
- # datomic (29)
- # emacs (12)
- # fulcro (29)
- # graphql (3)
- # helix (2)
- # hoplon (39)
- # hugsql (4)
- # malli (3)
- # off-topic (62)
- # pedestal (8)
- # re-frame (23)
- # reagent (14)
- # rewrite-clj (10)
- # shadow-cljs (18)
- # spacemacs (3)
- # sql (13)
- # xtdb (32)
So I finally figured out that I should be using X-Ray, and I’m using it to debug some performance problems in my DynamoDB code. One in particular is very mysterious, this is the X-Ray view. This is using promesa/all
to run a series of queries, but it looks like each one takes more time than the previous ones as if there were contention of some kind. The query is against a table using equality on the primary key of a secondary index:
(defn get-renewals
"Given a seq of previous orders, returns a vector of renewal details for all
of them as a promise."
[db previous]
(let [ids (->> previous
(map :order-id)
(set))
promises (map #(dynamo/query db {:table :licence-renewals
:where {:renewed-from [:= %]}
:index :renewals})
ids)]
(-> (p/all promises)
(then #(mapcat identity %)))))
This table is small (~2250 elements). Any ideas why this might be taking so long?