Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8029333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:24:18+00:00 2026-06-05T00:24:18+00:00

I have some spider that download pages and store data in database. I have

  • 0

I have some spider that download pages and store data in database. I have created flask application with admin panel (by Flask-Admin extension) that show database.
Now I want append function to my flask app for control spider state: switch on/off.

I thing it posible by threads or multiprocessing. Celery is not good decision because total program must use minimum memory.

Which method to choose for implementation this function?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T00:24:19+00:00Added an answer on June 5, 2026 at 12:24 am

    Discounting Celery based on memory usage would probably be a mistake, as Celery has low overhead in both time and space. In fact, using Celery+Flask does not use much more memory than using Flask alone.

    In addition Celery comes with several choices you can make that can have an impact
    on the amount of memory used. For example, there are 5 different pool implementations that all have different strengths and trade-offs, the pool choices are:

    • multiprocessing

    By default Celery uses multiprocessing, which means that it will spawn child processes
    to offload work to. This is the most memory expensive option – simply because
    every child process will duplicate the amount of base memory needed.

    But Celery also comes with an autoscale feature that will kill off worker
    processes when there’s little work to do, and spawn new processes when there’s more work:

    $ celeryd --autoscale=0,10
    

    where 0 is the mininum number of processes, and 10 is the maximum. Here celeryd will
    start off with no child processes, and grow based on load up to a maximum of 10 processes. When load decreases, so will the number of worker processes.

    • eventlet/gevent

    When using the eventlet/gevent pools only a single process will be used, and thus it will
    use a lot less memory, but with the downside that tasks calling blocking code will
    block other tasks from executing. If your tasks are mostly I/O bound you should be ok,
    and you can also combine different pools and send problem tasks to a multiprocessing pool instead.

    • threads

    Celery also comes with a pool using threads.

    The development version that will become version 2.6 includes a lot of optimizations,
    and there is no longer any need for the Flask-Celery extension module. If you are not going
    into production in the next days then I would encourage you to try the development version
    which must be installed like this:

    $ pip install https://github.com/ask/kombu/zipball/master
    $ pip install https://github.com/ask/celery/zipball/master
    

    The new API is now also Flask inspired, so you should read the new getting started guide:

    http://ask.github.com/celery/getting-started/first-steps-with-celery.html

    With all this said, most optimization work has been focused on execution speed so far,
    and there is probably many more memory optimizations that can be made. It has not been a request so far, but in the unlikely event that Celery does not match your memory constraints, you can open up an issue at our bug tracker and I’m sure it will get focus, or you can even help us to do so.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some files that are uuencoded, and I need to decode them, using
I have some script in my default page that redirects users to language specific
I have some XML which contains records and sub records, like this: <data> <record
I have some jquery code that is doing an ajax lookup and returning comma
I have some data with one row of headers and one or more rows
I have written a scrapy spider to scrape out some html tags. Now the
I have some jQuery that creates a slideshow using BX slider for an unknown
I have some code that does custom drawing. Basically it is form fill program
My URL http://www.ilandeistudio.com/store/ Below the main slider I have some images and categories..How can
I am developing an ASP.NET web application and I have some images in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.