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 7737805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:05:58+00:00 2026-06-01T08:05:58+00:00

I have a daemon that does the following retrieves site members from a mysql

  • 0

I have a daemon that does the following

  • retrieves site members from a mysql database (I used LIMIT 1000 to retrieve 1000 rows at a time)
  • send information about these members to a third party server
  • flag each member as having been processed
  • Sleep for 2 seconds
  • Retrieve the next batch of 1000 “unprocessed” members and send to third party server.
    and so on.

I am wondering whether a php daemon (I am using the system Daemon library), is the best way to accomplish this task delineated above.

I am worried of wasting too much memory (as PHP is known for that)

I am also worried about sending multiple requests to third party server, because on a high traffic day, there can be a lot of nonreceipts.

Is there a tool other than daemon I can use to accomplish this task? What methods can I implement to make this efficient considering there is a possibility of having to process over 100K rows in the mysql table, and the task is time sensitive. Also, at what point should I consider adding more servers?

Thanks!

  • 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-01T08:05:59+00:00Added an answer on June 1, 2026 at 8:05 am

    A cron should be a very good option for doing a sync job with a third party server.
    Consider the following ‘improvments’:

    1) A lock file to prevent multiple jobs from starting in parallel and taking extra resources from other processes you have running. And also to avoid duplicate processing of data.

    2) If you don’t have already implement an ‘information update’ and ‘sync time’ check on your side. For example if user A hasn’t suffered any changes since he was sync you don’t sync him again.

    3) Consider how often you need data to be sync and if it doesn’t have to be real time factor that into the selection query. Combined with user/time distribution and other factors you migth end up having periods of time when your script doesn’t sync that many accounts.

    4) Do your own memory cleanup unsetting variables, unlinking files and even reusing the same variables so you don’t have garbage variables that are a 1 time use only inside the scripts. Carefull with this as it might lead to obfuscating the code.

    Also consider using smaller datasets when you send them to php for processing. Databases love big datasets, php doesn’t.

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

Sidebar

Related Questions

I have to do the following: I have a Daemon set up that every
I have a small daemon that I'm writing in C and I need a
I have to write a daemon program that constantly runs in the background and
I have a daemon process written in Perl that uses Inotify2 to watch directories
To create a daemon I have read somewhere that in order to close all
I'm using HAProxy 1.4.22. I have the following haproxy.conf file: global maxconn 100000 daemon
I have a producer that reads from a twitter stream and places tasks on
I need to write a daemon that supposed to have one TCP socket and
I'm currently writing a Java daemon. I'm writing a script that will have the
I currently have a script that takes 1,000 rows at a time from a

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.