Python tips for memory optimization

前端 未结 7 1859
心在旅途
心在旅途 2020-12-24 04:07

I need to optimize the RAM usage of my application.
PLEASE spare me the lectures telling me I shouldn\'t care about memory when coding Python. I have a memory problem be

7条回答
  •  佛祖请我去吃肉
    2020-12-24 04:11

    Redis would be a great option here if you have the option to use it on a shared host - similar to memcached, but optimised for data structures. Redis also supports python bindings.

    I use it on a day to day basis for number crunching but also in production systems as a datastore and cannot recommend it highly enough.

    Also, do you have an option to proxy your app behind nginx instead of using Apache? You might find (if allowed) this proxy/webapp arrangement less hungry on resources.

    Good luck.

提交回复
热议问题