Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Commit

Permalink
Add performance workaround to readme (#849)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdmcclur authored Jul 27, 2020
1 parent 02083c8 commit e70730b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions incubator/nodejs-express/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,33 @@ The [`pino-http`](https://registry.npmjs.org/pino-http) has been registered as m
- Metrics endpoint: http://localhost:3000/metrics
- Dashboard endpoint: http://localhost:3000/appmetrics-dash (development only)
## Performance Considerations
The node-rdkafka package included in nodejs-express/image/project/package.json may cause long build times in some environments.
As a workaround, a modified appsody stack based on the node-express stack can be created.
See https://developer.ibm.com/components/appsody/tutorials/modify-appsody-stack/
- If kafka is not needed, simply remove the node-rdkafka dependency.
- If kafka is needed:
1. Create a new base image based on node:12 with the librdkafka libray pre-installed.
```
FROM node:12

RUN apt-get update && \
apt-get install -y libssl-dev && apt-get clean && \
git clone https://github.com/edenhill/librdkafka.git && \
cd librdkafka && \
./configure --install-deps && \
make && \
make install
```
2. Change the top of nodejs-express/image/project/Dockerfile to use the new base image and set an environment variable.
```
FROM [IMAGE CREATED ABOVE]

ENV BUILD_LIBRDKAFKA=0
```
## License
This stack is licensed under the [Apache 2.0](./image/LICENSE) license

0 comments on commit e70730b

Please sign in to comment.