Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres up CPU to 340% #227

Open
KhaledAld opened this issue Sep 25, 2018 · 0 comments
Open

Postgres up CPU to 340% #227

KhaledAld opened this issue Sep 25, 2018 · 0 comments

Comments

@KhaledAld
Copy link

KhaledAld commented Sep 25, 2018

I just setup Skygear server with docker-compose and Postgres.
when I use chat (send a message or typing ) Postgres is using up to 340% CPU.
This issue appears just when using chat.
Below is my compose file:

version: '2'

services:
db:
image: mdillon/postgis:9.5
ports:

  • "5432:5432"
    volumes:
  • db_data:/var/lib/postgresql/data

app:
image: quay.io/skygeario/skygear-server:latest
ports:

  • "3001:3000"
    volumes:
  • app_data:/go/src/app/data
    links:
  • db
    command: skygear-server
    environment:
    DATABASE_URL: postgresql://postgres:@db/postgres?sslmode=disable
    APP_NAME: giftedChat
    API_KEY: larsa
    MASTER_KEY: larsa_comp
    TOKEN_STORE: jwt
    TOKEN_STORE_SECRET: jwt_secret
    PLUGINS: JS,CHAT
    JS_TRANSPORT: http
    JS_PATH: http://jsplugin:9000
    CHAT_TRANSPORT: zmq
    CHAT_PATH: chat
    CHAT_ARGS: tcp://0.0.0.0:5555
    ASSET_STORE: fs
    ASSET_STORE_URL_PREFIX: http://localhost:3000/files
    ASSET_STORE_SECRET: khaled_ald_gifted
    APNS_ENABLE: "YES"
    APNS_ENV: sandbox
    APNS_TYPE: token
    APNS_KEY_ID: xxxxxxxxxxxx
    APNS_TEAM_ID: xxxxxxxxxxxxx
    APNS_TOKEN_KEY_PATH: /app/data/cert/khaled.p8
    CUSTOM_TOKEN_SECRET: xxxxxxxxxxxxx

plugin:
build:
context: .
links:

  • app
  • db
    volumes:
  • ./:/usr/src/app
    command: py-skygear chat
    environment:
    DATABASE_URL: postgresql://postgres:@db/postgres?sslmode=disable
    PUBSUB_URL: ws://app:3000/pubsub
    SKYGEAR_ADDRESS: tcp://app:5555
    SKYGEAR_ENDPOINT: http://app:3000
    APP_NAME: giftedChat
    API_KEY: larsa
    MASTER_KEY: larsa_comp
    TOKEN_STORE_SECRET: jwt_secret
    ASSET_STORE_URL_PREFIX: http://localhost:3000/
    ASSET_STORE: fs
    ASSET_STORE_SECRET: khaled_ald_gifted
    ZMQ_MAX_BOUNCE: 1

jsplugin:
image: quay.io/skygeario/skygear-node:canary
volumes:

  • .:/usr/src/app
    environment:
    DATABASE_URL: postgres://postgres@db/postgres?sslmode=disable
    PUBSUB_URL: PUBSUB_URL=ws://app:3000/pubsub
    SKYGEAR_ENDPOINT: http://app:3000
    API_KEY: larsa
    MASTER_KEY: larsa_comp
    APP_NAME: giftedChat
    ASSET_STORE: fs
    ASSET_STORE_SECRET: khaled_ald_gifted
    ASSET_STORE_URL_PREFIX: http://localhost:3000/

volumes:
db_data:
driver: local
app_data:
driver: local

Any Suggestion ???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant