Skip to content

Instantly share code, notes, and snippets.

View sachinpkale's full-sized avatar

Sachin Kale sachinpkale

  • AWS
  • Bangalore, India
View GitHub Profile
@sachinpkale
sachinpkale / jetty_tuning.md
Last active June 1, 2017 08:56
Jetty tuning for ring-jetty-adapter

Problem Statement

Clojure services generally use default configuration for ring.adapter.jetty. Adapter provides many configuration options as listed here. We will talk about two important configurations parameters while tuning Jetty: max-threads and accept-queue-size. Following are the default values:

  • max-threads 50
  • accept-queue-size 2^31 -1 For high throughput server, it is required to tune these parameters and not just rely on the default values.

How it works

  • In Jetty, each new request is added to a BlockingArrayQueue. Queue size is bound by accept-queue-size.
@sachinpkale
sachinpkale / ns-cheatsheet.clj
Last active September 12, 2016 11:09 — forked from ghoseb/ns-cheatsheet.clj
Clojure ns syntax cheat-sheet
;;
;; NS CHEATSHEET
;;
;; * :require makes functions available with a namespace prefix
;; and optionally can refer functions to the current ns.
;;
;; * :import refers Java classes to the current namespace.
;;
;; * :refer-clojure affects availability of built-in (clojure.core)
;; functions.