diff --git a/lib/connection.js b/lib/connection.js
index <HASH>..<HASH> 100644
--- a/lib/connection.js
+++ b/lib/connection.js
@@ -52,7 +52,7 @@ function Connection (opts)
   this._paused_packets = new Queue();
 
   this._statements = LRU({
-    max: 1000,
+    max: this.config.maxPreparedStatements,
     dispose: function (key, statement) { statement.close(); }
   });
 
diff --git a/lib/connection_config.js b/lib/connection_config.js
index <HASH>..<HASH> 100644
--- a/lib/connection_config.js
+++ b/lib/connection_config.js
@@ -70,6 +70,7 @@ function ConnectionConfig (options) {
                                                  options.flags || '');
 
   this.connectAttributes = options.connectAttributes;
+  this.maxPreparedStatements = options.maxPreparedStatements || 16000;
 }
 
 ConnectionConfig.mergeFlags = function (default_flags, user_flags) {
added option to override max prepared statements cache