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

  • Home
  • SEARCH
  • 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 5990819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:17:54+00:00 2026-05-22T23:17:54+00:00

Situation: A user submits a url and my php script adds that url to

  • 0

Situation: A user submits a url and my php script adds that url to a “queue” table in the database. And suppose that there will be at least 1000 urls inserted to that “queue” table per minute. What I am going to do with the url is grab the contents of the url and then some quick parse work with the contents.

My Solution: Was thinking of creating a daemon which will keep checking the “queue” table and grabs the rows available every time it checks. And then work with the data retrieved, update data from another table, and then delete the rows when that cycle completes, then repeat again. It may take up to maybe 1ms-3ms for each row to complete. (Btw, I’m using InnoDB tables)

Question: So would you say this would be a good way of doing this? Or is there something better? – I don’t want to use any heavy systems though, like to keep stuff short and simple if possible 🙂

  • 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-05-22T23:17:55+00:00Added an answer on May 22, 2026 at 11:17 pm

    I would say you only grab 1 row at the time instead of all your rows. Here’s why:

    Say you have 1000 entries in your table, your script comes, takes all 1000 in memory (warning sign 1 for high memory usage) and starts processing. Processing 1000 entries takes 5 minutes, but your script runs every 3 minutes. This means that by the time your first thread is processing row 674 (e.g.), your second thread starts processing row 1, as your database hasn’t been updated yet (warning sign 2: multi threaded behaviour).

    This also works for when you let multiple threads run your queue at once.

    Application flow:

    • Script starts, takes first row with a flag of ‘unprocessed’
    • Immediatly set it’s flag to ‘processing’
    • Process that URL
    • Set the flag to ‘processed’

    Instead of using flags, you could also use row-locking in your database. But this is very prone to deadlocks, so be careful.

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

Sidebar

Related Questions

Here is the situation: User looks something up. Alert sound is played because there
I have the following situation: A user will define a certain filter on a
I have following situation: I have loged user, standard authentication with DB table $authAdapter
In .NET (C#, specifically), how can I stop navigation? Situation: User has clicked a
The situation is as follows: I've got 2 models: 'Action' and 'User'. These models
I have a situation where in a web application a user may need a
I have a situation where I have to take input from the user using
Situation: I have a simple XML document that contains image information. I need to
Using ASP.NET MVC there are situations (such as form submission) that may require a
edit: this is now solved, see my answer below The situation: User clicks on

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.