Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4832 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi,

I'm using a script to process records submitted via a php Web form -- it sends a receipt to the submitter and sends a report to certain recipients outside the organization. The script starts on the last record and moves backward until it runs out of unprocessed records.

Since I'd like the emails to be as instant as possible, I've set up a server script to execute it once per minute, all day long.

I don't feel great about this solution though. Is an every-minute script as brief as this one likely to cause worrisome load on the server?

The other option I would pursue would be to have the script run on only one record and call it from php after a record is submitted. i just don't have as much experience with that kind of thing in php.

What's the best way to go about this?

Thanks,

Kelly

Posted

If you were wanting a particular procedure to run after a user submits some information, I would submit that the best thing to do is have the script run right after the submission. It is very possible to run a FileMaker script inside of PHP code.

The gotcha on this one is that you have to ensure the script is 'web compatible' meaning all of the steps are capable of running under a web environment (Indicate web compatibility feature)

Here is a good whitepaper on how to execute FMscripts through PHP - http://www.filemaker.com/downloads/pdf/article2_php.pdf

Having a server script run that often probably isn't going to be a problem. Unless you have a huge number of records to process/find through. But I would think the way you described what the script does is that most of the time the script will be searching for something to process, not find anything and repeat that every X minutes.

Posted

For what it's worth, I have a FileMaker Pro install running what I call the "Robot" which runs every 15 minutes. I used to run it every 5 minutes with no noticeable performance problems. NOTE: These scripts have nothing to do with FileMaker Server's built-in ability to run scripts.

Posted

I have been running a "once per minute" script for YEARS to do exactly what you are describing - no problems, and works just fine.

Think...the more frequently you run the script, the less records there are to process, therefore lighter load on the server - not that shipping a few emails is particularly demanding.

Posted

It depends on what the script does. I have one that sends mail with attachments, and one record averages 7 seconds to send. Under heavy periods there can be 100s of records to process. I have it set to run every 30 minutes.

Posted

Does any one know what happens if a second instance of the script is executed before the first one completes?

Posted

Thanks all.

I ended up opting to call the script from php after the form submits, which works fine in and of itself. Unfortunately, one of the email addresses it sends to is in a related table in a separate file and it doesn't seem to be able to pull that data in (works fine in the client, just not in php). That's probably for a separate post, but I'd love to hear any ideas on it.

IdealData, I can't say for sure about the script getting interrupted, but that's why I have my script loop through looking for unprocessed records rather than just process the current record. If the script doesn't fire on one record, the script will get it the next time it runs.

Posted

And here's my post on that issue, if anyone's interested:

http://fmforums.com/forum/topic/79951-php-and-relationships-with-separate-files/

This topic is 4832 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.