Conjure's response time

8 views
Skip to first unread message

jarik

unread,
Dec 17, 2010, 1:07:56 PM12/17/10
to Conjure
Hi,
I'm evaluating Conjure and done with tutorials. I'm worrying about the
response time. A simple application from tutorials has the response
time around 1 sec. Why is it so long?

Logs:
...
DEBUG [conjure.core.server.ring-adapter]: Response time: 1282 ms
...
DEBUG [conjure.core.server.ring-adapter]: Response time: 1389 ms
...
DEBUG [conjure.core.server.ring-adapter]: Response time: 1366 ms
...
DEBUG [conjure.core.server.ring-adapter]: Response time: 1294 ms
...

Matthew Courtney

unread,
Dec 17, 2010, 2:17:42 PM12/17/10
to clojure...@googlegroups.com
Are you running in the test or production environment. By default, if
you run "lein conjure server" from the command line, you're running in
the test environment. In the test environment, all clojure files are
reloaded to pick up any changes during development which causes the very
slow page load time.

To run in production mode from the command line use "lein conjure server
-mode production". No files are reloaded in the production mode. You
should see a significant speed improvement.

-Matt Courtney

jarik

unread,
Dec 17, 2010, 4:22:20 PM12/17/10
to Conjure
After completing the tutorial I used "lein conjure server -mode
production" to run it
and tested with siege for http://127.0.0.1:8080/message/list_records
Look what I've got:
Transactions: 289 hits
Availability: 100.00 %
Elapsed time: 264.37 secs
Data transferred: 1.43 MB
Response time: 12.91 secs
Transaction rate: 1.09 trans/sec
Throughput: 0.01 MB/sec
Concurrency: 14.12
Successful transactions: 289
Failed transactions: 0
Longest transaction: 20.28
Shortest transaction: 7.58

Then I used a simple view's code for index-controller:
(def-view [message messages]
[:div {:class "artocle"}
[:h1 "Welcome to Conjure!"]
[:p "Hello world!"]])

And ran it again. I thought that maybe clj-record & mysql was the
trouble maker, but I had again this:
Transactions: 59 hits
Availability: 100.00 %
Elapsed time: 59.86 secs
Data transferred: 0.16 MB
Response time: 13.18 secs
Transaction rate: 0.99 trans/sec
Throughput: 0.00 MB/sec
Concurrency: 12.99
Successful transactions: 59
Failed transactions: 0
Longest transaction: 18.16
Shortest transaction: 7.00

For example a simple compojure's application using clj-record similar
to this tutorial gave me:
Transactions: 1852 hits
Availability: 100.00 %
Elapsed time: 59.89 secs
Data transferred: 1.55 MB
Response time: 0.02 secs
Transaction rate: 30.92 trans/sec
Throughput: 0.03 MB/sec
Concurrency: 0.56
Successful transactions: 1852
Failed transactions: 0
Longest transaction: 0.12
Shortest transaction: 0.00


The difference is great! I can't get why... Maybe session handling...
Any ideas?

Matthew Courtney

unread,
Dec 20, 2010, 9:36:04 AM12/20/10
to clojure...@googlegroups.com
Your numbers are very different than what I've experienced. Once in
production mode, I hardly ever see a response time of 1 second.

Now, Compojure will always be faster for simple webpages since Conjure
does so much extra work. However, for more complicated pages which
actually need Conjure's framework, the performance should be comparable.

If you want to reduce the session handling overhead, you could switch to
the memory-session-store. In session_config.clj, simply change all
references to database-session-store to memory-session-store. Let me
know if there is much improvement.

Also, if you find specific areas where conjure is much slower, let me
know, and I'll see if I can optimize them.

-Matt Courtney

Reply all
Reply to author
Forward
0 new messages