Lemmy.World
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
RSS Bot@lemmy.bestiver.seBM to Hacker News@lemmy.bestiver.seEnglish · 1 year ago

It is hard to recommend Python in production

ashishb.net

external-link
message-square
2
link
fedilink
0
external-link

It is hard to recommend Python in production

ashishb.net

RSS Bot@lemmy.bestiver.seBM to Hacker News@lemmy.bestiver.seEnglish · 1 year ago
message-square
2
link
fedilink
I started writing in the 2010s when Python 2 was going to be deprecated and Python 3 was too early to support. Python might have died there and then but was picked up by the data science and machine learning community, so, it survived. Running Python in production comes with various gotchas though. Python is resource-intensive Let’s consider a simple Docker image containing “Hello World”. Docker 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 # Build: docker buildx build -t python-fastapi -f Dockerfile_python . # Size: docker image inspect python-fastapi --format='{{.Size}}' | numfmt --to=iec-i # Run: docker run -it --rm --cpus=1 --memory=100m -p 8000:8000 python-fastapi FROM python:3.12-slim AS base WORKDIR /app RUN pip3 install --no-cache-dir fastapi==0.115.11 uvicorn==0.34.0 SHELL ["/bin/bash", "-c"] RUN echo -e "\ from fastapi import FastAPI\n\ app = FastAPI()\n\ @app.get('/')\n\ async def root():\n\ return {'message': 'Hello World'}\ " > /app/web_server.py ENTRYPOINT [ "uvicorn", "web_server:app", "--host=0.0.0.0", "--port=8000", "--workers=4", "--limit-concurrency=32"] And a similar web server in Go.

Comments

alert-triangle
You must log in or register to comment.
  • Telex@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    It is not.

  • Hejej@lemmy.ml
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    How could are LLMs at translating programming languages? Python to GO, best of both

Hacker News@lemmy.bestiver.se

hackernews@lemmy.bestiver.se

Subscribe from Remote Instance

You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]
lock
Community locked: only moderators can create posts. You can still comment on posts.

Posts from the RSS Feed of HackerNews.

The feed sometimes contains ads and posts that have been removed by the mod team at HN.

Source of the RSS Bot

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 626 users / day
  • 1.71K users / week
  • 3.63K users / month
  • 9.2K users / 6 months
  • 917 local subscribers
  • 5.36K subscribers
  • 59.8K Posts
  • 30.6K Comments
  • Modlog
  • mods:
  • patrick@lemmy.bestiver.se
  • RSS Bot@lemmy.bestiver.seB
  • UI: 0.19.20-5-ga406e80b
  • BE: 0.19.19-9-gc55dd700c
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org