Flags

Discussion in 'PHP' started by deriklogov, Aug 26, 2009.

  1. #1
    I have about 100 scripts which are running, some of them can not be run at the same time with others so between those scripts I create flags 0 - 1 with text files, script before proceed are reading text file if its 1 its ok to go if 0 than script stop executing.

    After a month of work I hit performance problems with those scripts because cron run those scripts every minute ( not all of them at the same time but some of them) so my question is, is there any difference in performance if I will move those flags from text files and will create them in MYSQL.

    What is your opinion ?

    Thank You
     
    deriklogov, Aug 26, 2009 IP
  2. superdav42

    superdav42 Active Member

    Messages:
    125
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #2
    I would go with using the database but that's more of a personal taste than anything. It just seems like a cleaner solution to me. Both probably work and I doubt there's much of a performance difference because all the work will be in actually running the scripts. I would work on optimizing the scripts themselves if possible.
     
    superdav42, Aug 26, 2009 IP
  3. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #3
    Well what u use i think is called a flat file solution i dont think there is much of a diffrence atleast a big diffrence but mysql is little easier to manage and is a better solution overall
     
    Bohra, Aug 26, 2009 IP
  4. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Unless you have overlap in your crons (and two scripts try to write to the same file at the same time, etc) you shouldn't have any issues with using simple text files. Your performance problem is likely elsewhere.
     
    premiumscripts, Aug 26, 2009 IP