This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-03
Channels
- # aleph (3)
- # announcements (1)
- # beginners (116)
- # boot (8)
- # braveandtrue (4)
- # cider (40)
- # cljdoc (120)
- # cljsrn (10)
- # clojure (29)
- # clojure-austin (4)
- # clojure-dev (43)
- # clojure-germany (1)
- # clojure-italy (4)
- # clojure-nl (17)
- # clojure-russia (19)
- # clojure-uk (76)
- # clojurescript (118)
- # cursive (13)
- # datascript (11)
- # datomic (73)
- # emacs (24)
- # figwheel-main (176)
- # fulcro (40)
- # hyperfiddle (4)
- # leiningen (3)
- # off-topic (1)
- # pedestal (4)
- # re-frame (6)
- # reagent (22)
- # reitit (1)
- # ring (3)
- # rum (8)
- # shadow-cljs (41)
- # spacemacs (11)
- # specter (19)
- # unrepl (1)
my queries are getting really slow and i took a look at memcache, this would appear that memcache is not being used at all right ?
Hi @U1DBQAAMB -- that looks odd, what Statistic are you graphing there?
"getting really slow" implies change over time, what else (if anything) is changing over time?
according to docs https://docs.datomic.com/cloud/operation/monitoring.html#metrics this metric shows the number of cache hits
in regards to slowness... i have two queries that do a regex on a word to find a partial match... like an autocomplete, the queries have gotten so slow that sometimes it goes over 60 seconds and gets taken off the load balancer and then i have a range of other problems. I believe they're getting slower because the growing number of records
but actually... there's well under 100k records in the query, so i feel like it shouldn't be that slow
searching 100k records should be blazing fast
this is On-Prem?
I would love to see the query. Also, how big are the records? Are they bits of text? Documents? Tomes?
vs. Cloud
[{:find [?u],
:in [$ % ?orgid],
:where [(find-relationship ?u ?orgid)]}
[email protected]
[[(find-relationship ?u ?orgid)
[?perm :permission/user ?u]
[?perm :permission/ent ?orgid]]
[(find-relationship ?u ?orgid)
[?o :transaction/user ?u]
[?li :line_item/transaction ?o]
[?li :line_item/organization ?orgid]]
[(find-relationship ?u ?orgid)
[?o :domain/organization ?orgid]
[?o :domain/user ?u]]] 17592186045798]
[{:find [?u],
:in [$ % ?orgid [?attrs ...] ?stext],
:where [(find-relationship ?u ?orgid)
[?u ?attrs ?val]
[(im.models.user.queries/includes-i? ?val ?stext)]]}
[email protected]
[[(find-relationship ?u ?orgid)
[?perm :permission/user ?u]
[?perm :permission/ent ?orgid]]
[(find-relationship ?u ?orgid)
[?o :transaction/user ?u]
[?li :line_item/transaction ?o]
[?li :line_item/organization ?orgid]]
[(find-relationship ?u ?orgid)
[?o :domain/organization ?orgid]
[?o :domain/user ?u]]] 17592186045798
[:user/name :user/email] "[email protected]"]
(defn includes-i? [in out]
(clojure.string/includes? (clojure.string/lower-case in) out))
@U1DBQAAMB to be seeing the slowdown you are describing, I would imagine that the query is considering several orders of magnitude more than 100K records
the two most likely causes for this (if your data set is small) are covered in the docs here:
1. https://docs.datomic.com/on-prem/best-practices.html#most-selective-clauses-first
when rules are involved, you can ensure that things are bound in the order you expect by using the "required variable" shape when creating rules https://docs.datomic.com/on-prem/query.html#rules
maybe, but that slowness would impact everything (all queries)
100k records should fit in memory, at which point the memcache is not being consulted ever
you could look at the ObjectCache sum and average values
the sum would tell you how much cache you need
and the average would tell you how often you were hitting memory, without ever needing memcache
there's well over 100k records in the whole db more like 10M.... sorry i wasn't being clear, i meant 100k records of from the point of the first where clause
( i was thinking of my "users" like a SQL table, forgot it's nothing like that in datomic)
sorry to keep bothering you 😐 I just wanted to point out that the exact same query is slow in one instance and blazing fast in another, i don't know if that's helpful
@U1DBQAAMB if you are restarting processes, then the query could be slow the first time, and fast on subsequent times
how hard is it for you to experiment with memcached disabled?
^^ if that makes things better then you certainly know you have a memcached config problem
i mean... i have no way of seeing that it's being touched. there are in fact 80M datoms, and i believe i followed the instructions correctly for memcached support ( i used the cloud formation template and i pass datomic.memcachedServers as args to the JVM). I would just like to see one single read or validate the connection is used at all... otehrwise i would just spin down the cache and use more peers
Hello, I have created a new database with a schema and am trying to add data to it
(require '[datomic.api :as d])
(def db-uri "datomic:)
(d/create-database db-uri)
(def conn (d/connect db-uri))
(def schema
[{:db/ident :movie/title
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one
:db/doc "The title of the movie"}
{:db/ident :movie/genre
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one
:db/doc "The genre of the movie"}
{:db/ident :movie/release-year
:db/valueType :db.type/long
:db/cardinality :db.cardinality/one
:db/doc "The year the movie was released in theaters"}])
@(d/transact conn schema)
(def movies [{:movie/title "The Goonies"
:movie/genre "action/adventure"
:movie/release-year 1985}
{:movie/title "Commando"
:movie/genre "action/adventure"
:movie/release-year 1985}
{:movie/title "Repo Man"
:movie/genre "punk dystopia"
:movie/release-year 1984}])
(d/transact conn {:tx-data movies})
When I run it in the datomic REPL, I get ClassCastException clojure.lang.PersistentArrayMap cannot be cast to java.util.List datomic.api/transact (api.clj:92)
. Any chances that you can see what I am doing wrong?I think you are using the peer api instead of the client api. for peer txns you don’t put the entities in a map with :tx-data. try (d/transact conn movies) or try switching to the client api instead of datomic.api
Thanks for your insight! I am going to have to learn more about the differences between the two. 🙂
yeah, all the little differences caught me out too when I migrated from peer to client. I think of it like peer is v1 and client/cloud is v2
Hi @UCM1FJA4E & @U0510KXTU! Let us know if you find something absent or confusing at https://docs.datomic.com/on-prem/moving-to-cloud.html.
👍 Thanks, will do.
When I read the documentation again I noticed that it mentioned the Client API so that made sense.
hi, I see that for versions >= 402 you can choose t2.small for the datomic instances instead of i3.large, but the documentation still mentions i3.large for production topology. we have 1% cpu utilization on the i3.large instances, so having smaller ones makes sense I guess. What are the recommendations here?
hi @U0539NJF7 -- the i3s are doing more for you than just CPU, e.g. the SSD caches keep your data hot across ion deploys
also the primary group instances have to do all the housekeeping work for Datomic, which is bursty and unrelated to your transaction load
all that said, we do not currently support anything smaller than i3.large for the production topology
are you (yet?) hosting your application code as ions?
if/once you move to ions, your next tier out will disappear entirely (eliminating those instance costs, if any), and that load will be on the i3.larges, increasing the CPU utilization there
I understand, but we need quite a refactor for that as we're running on elastic beanstalk right now
it is definitely our intent that the baseline prod topology be a cost-effective way to host an entire application -- if you are not finding it so, I would be happy to look at the details -- you can email me <mailto:[email protected]|[email protected]>
no, I think the cost is not extreme for our production usage right now, just wondering why the marketplace mentions t2.small and was looking if that would be an option
backstory: the marketplace was originally designed to sell ec2 instances (not Cloud-native solutions) and then gradually upfit to support systems that use CFT and run multiple services
as a result, the marketplace UI thinks EC2 instances are the center of the universe, and does not anticipate different topologies with different capabilities
so there are various places where the UI suggests instance/CFT combinations that are not practicable, nor permitted
sorry for the confusion! we are working on it
I’m inexperienced in both AWS and Datomic, so sorry if this is dumb: I’m currently using the solo config and seeing a bunch of alerts about INSUFFICIENT_DATA. anything I should be doing when I see those?
generally not a problem! https://stackoverflow.com/questions/33639642/avoiding-insufficient-data-in-cloudwatch
if the system is running (e.g. you are able to follow the instructions and connect) then you are fine