diff --git a/README.md b/README.md index b05a1a5..be6b980 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ It is best practice to work within a python virtual environment for both develop ```sh # run the following from the top-level directory of your python project -python3 -m venv env-name # creates the environment +python3 -m venv venv # creates the environment source venv/bin/activate # activates the environment deactivate # deactivates the environment ``` @@ -210,4 +210,20 @@ docker-compose -f docker-compose.yml -f docker-compose.test.yml up -d --build then wait for the elastic search container to come up (use `docker-compose logs -f` to see it if you like), then execute the -following (from the top-level directory of this repo): +following (from the top-level directory of this repo, having +activated the virtual environment you created earlier): + +``` +python -m pytest tests +``` + +## Examining memory usage in elasticsearch + +``` +$ docker-compose exec elasticsearch bash +elasticsearch@7b6eb4ff0455:~$ curl "localhost:9200/_nodes/stats?filter_path=nodes.*.jvm.mem.pools.old" +{"nodes":{"w9Hm2YGAT7iorZM3JTYlUA":{"jvm":{"mem":{"pools":{"old":{"used_in_bytes":29128704,"max_in_bytes":8589934592,"peak_used_in_bytes":41711616,"peak_max_in_bytes":8589934592}}}}}}} +elasticsearch@7b6eb4ff0455:~$ exit +``` + +This shows us 291M used, 8.5G max. diff --git a/docker-compose.yml b/docker-compose.yml index 8900b92..e0f119e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -25,6 +25,7 @@ services: - xpack.security.enabled=false - http.cors.enabled=true - http.cors.allow-origin=/http:\/\/(elasticsearch|localhost):9200/ + - "ES_JAVA_OPTS=-Xms4g -Xmx8g" volumes: - es_data:/usr/share/elasticsearch/data:rw