# MongoDB optimization pack

The *MongoDB* optimization pack helps you optimize instances of MongoDB to reach the desired performance goal. The optimization pack provides parameters and metrics specific to MongoDB that can be leveraged to reach, among others, two main goals:

* Throughput optimization - increasing the capacity of a MongoDB deployment to serve clients
* Cost optimization - decreasing the size of a MongoDB deployment while guaranteeing the same service level

To reach such goals the pack focuses mostly on the parameters managing the cache, being one of the elements that impact performances the most; in particular, the optimization pack provides parameters to control the lifecycle and the size of the MongoDB’s cache thus significantly impacting performance.

Even though it is possible to evaluate performance improvements of MongoDB by looking at the business application that uses it as its database, looking at the end to end throughput or response time or using a performance test like [YCSB](https://github.com/brianfrankcooper/YCSB), the optimization pack provides internal MongoDB metrics that can shed a light too on how MongoDB is performing, in particular in terms of throughput, for example:

* The number of documents inserted in the database per second
* The number of active connections

## Component types

The optimization pack supports the following version of MongoDB.

| Component Type                                                                                                   | Description         |
| ---------------------------------------------------------------------------------------------------------------- | ------------------- |
| [MongoDB-4](https://docs.akamas.io/akamas-docs/3.2.0/akamas-reference/optimization-packs/mongodb-pack/mongodb-4) | MongoDB version 4.x |
| [MongoDB-5](https://docs.akamas.io/akamas-docs/3.2.0/akamas-reference/optimization-packs/mongodb-pack/mongodb-5) | MongoDB version 5.x |

## Installing

Here’s the command to install the MongoDB optimization-pack using the Akamas CLI:

```bash
akamas install optimization-pack MongoDB
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.akamas.io/akamas-docs/3.2.0/akamas-reference/optimization-packs/mongodb-pack.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
