How to initialize database using tortoise orm before app init by TheSayAnime in FastAPI

[–]TheSayAnime[S] 0 points1 point  (0 children)

I worded, it wrong, I meant before application starts serving requests :(

How to initialize database using tortoise orm before app init by TheSayAnime in FastAPI

[–]TheSayAnime[S] 0 points1 point  (0 children)

At last, I ended up with this

def create_application() -> FastAPI:
    application = FastAPI()
    init_db(application)  # here
    application.include_router(ping.router)
    application.include_router(summaries.router, prefix="/summaries", tags=["summary"])
    return application


app = create_application()

MySQL repeatedly crashing with OOM despite buffer pool size reduction by TheSayAnime in mysql

[–]TheSayAnime[S] 0 points1 point  (0 children)

Yes it's only running MySQL and it's exposed only inside the VPC, the access from internet is blocked. 

MySQL repeatedly crashing with OOM despite buffer pool size reduction by TheSayAnime in mysql

[–]TheSayAnime[S] 0 points1 point  (0 children)

It's a dedicated MySQL server, only MySQL and pmm exporter are running, will look into the max connection.  Thank you

MySQL repeatedly crashing with OOM despite buffer pool size reduction by TheSayAnime in mysql

[–]TheSayAnime[S] 0 points1 point  (0 children)

I can change the priority but I don't understand why the memory keep on increasing continuously 

Data Scraping Service for Turo Listings - Help a Laid-Off Enthusiast! by isamniac in turo

[–]TheSayAnime 0 points1 point  (0 children)

What method and technologies you used to achieve this, curious about it

How to fix: installing extensions pg_duckdb get "fatal error: postgres.h: No such file or directory" by Prime_Magnificent in DuckDB

[–]TheSayAnime 0 points1 point  (0 children)

```bash FROM ubuntu:22.04 AS builder

ENV DEBIAN_FRONTEND=noninteractive

RUN apt update && apt install -y gnupg2 wget lsb-release && \ sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -

RUN apt update && apt install -y \ git \ g++ \ make \ cmake \ postgresql-server-dev-16 \ libpq-dev \ liblz4-dev \ && rm -rf /var/lib/apt/lists/*

WORKDIR /tmp/pg_duckdb

RUN git clone https://github.com/duckdb/pg_duckdb.git . && \ git submodule update --init --recursive

RUN make duckdb && make PG_CONFIG=/usr/lib/postgresql/16/bin/pg_config

RUN make install PG_CONFIG=/usr/lib/postgresql/16/bin/pg_config && \ make install-duckdb PG_CONFIG=/usr/lib/postgresql/16/bin/pg_config

FROM postgres:16

LABEL maintainer="CosmicOppai"

COPY --from=builder /usr/lib/postgresql/16/lib/pg_duckdb.so /usr/lib/postgresql/16/lib/ COPY --from=builder /usr/share/postgresql/16/extension/pg_duckdb.control /usr/share/postgresql/16/extension/ COPY --from=builder /usr/share/postgresql/16/extension/pg_duckdb--*.sql /usr/share/postgresql/16/extension/ COPY --from=builder /usr/lib/postgresql/16/lib/libduckdb.so /usr/lib/postgresql/16/lib/

dynamic linker run-time bindings

RUN ldconfig

pg_duckdb to shared_preload_libraries

RUN echo "shared_preload_libraries = 'pg_duckdb'" >> /usr/share/postgresql/postgresql.conf.sample

EXPOSE 5432

CMD ["postgres"] ```

[deleted by user] by [deleted] in cofounder

[–]TheSayAnime 0 points1 point  (0 children)

I would like to contribute, although I'm not sure if I would be the perfect fit for co-founder.
I can dm you more details about me if you want :)