Events in the Event Queue Not Running

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Events in the Event Queue Not Running

Seth Ganahl
I am at my wits end, and asking for help on behalf of a "client" who I am
essentially doing Pro Bono work for.

This is running on Lasso 8.5, OS X 10.6 (I think) on a shared hosted server
at Point in Space.

The site has an existing function to send bulk emails to its members using
pre-designed templates.  The problem occurs when they try to send the bulk
emails with an attachment.  Lasso will send 20 or so of the 200 emails
before timing out, and in the process completely bogging down the server.

My work around was to add the bulk email script to the Lasso Event Queue as
a Scheduled Event.  This worked wonderfully when I scheduled the event
through Lasso Admin.  The bulk email script fired off, all 200 emails went
out, and the system didn't spike at all.

So I setup a small script to automatically add an event to the Event Queue
with the parameters provided for the bulk email:

var: 'my_date'=(date: (date_add: date_getcurrentdate, -minute=1));
    inline:
        -database='site',
        -table='schedule',
        -keyfield='id',
        'date_time_start'=(date_format: ($my_date), -format='%Q %T'),
        'date_time_end'='3001-01-01 00:00:00',
        'next_execute'=(date_format: ($my_date), -format='%Q %T'),
       
'executeAction'='http://'(server_name)'/office/email_region_event.lasso?
            FN='$FN
            '&LN='$LN
            '&regStatus='$regStatus
            '&region='$reg
            '&officer='$officer
            '&Sender_Name='$Sender_Name
            '&subject='$subject
            '&cc='$cc
            '&footer='$footer
            '&pa='$pa
            '&attach='$attach
            '&att_filepath='$att_filepath
            '&template='$template
            '&em='$em
            '&incoming_name='$incoming_name
            '&message='$message,
        'repeat'=0,
        'restart'=1,
        'delay'=0,
        'user'=var('site_un'),
        'pass'=var('site_pw'),
        -username=var('admin_un'),
        -password=var('admin_pw'),
        -Add;

The event gets added to the Event Queue, but just sits there, and never gets
run.  If I manually pause, and resume the queue then the event runs as
expected.
-------------------------------------------------------
Seth C Ganahl (501) 282-4867
Ganahl Consulting ­ Web Applications
http://www.ganahlconsulting.com/
[hidden email]
-------------------------------------------------------



#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

RE: Events in the Event Queue Not Running

Rick Draper-2
Hi Seth,

What size is the attachment?

We had a situation a long while ago where sending multiple emails with the same large attachment would use up all the resources on the box - admittedly this was 8.5.6 on Windows, but might be a clue.

VBR

Rick




#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Events in the Event Queue Not Running

Seth Ganahl
The latest attachment they were trying to send was 7.2 MB.  Not terribly
large.

I though my work around was pretty clever, and it worked...except for the
whole Event Queue not running thing.


On 12/1/13 3:18 PM, "Rick Draper" <[hidden email]> did quoth:

> Hi Seth,
>
> What size is the attachment?
>
> We had a situation a long while ago where sending multiple emails with the
> same large attachment would use up all the resources on the box - admittedly
> this was 8.5.6 on Windows, but might be a clue.
>
> VBR
>
> Rick
>
>
>
>
> #############################################################
> This message is sent to you because you are subscribed to
>   the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

-------------------------------------------------------
Seth C Ganahl (501) 282-4867
Ganahl Consulting ­ Web Applications
http://www.ganahlconsulting.com/
[hidden email]
-------------------------------------------------------



#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Events in the Event Queue Not Running

Brad Lindsay
In reply to this post by Seth Ganahl
Seth,

Instead of manually adding the event to the database, have you checked
out the [event_schedule] tag?
        http://www.lassosoft.com/lassoDocs/languageReference/obj/Event_Schedule

This should allow you to programmatically add events to the queue that
actually get run.

Brad



On 12/1/13, 4:08 PM, Seth Ganahl wrote:

> I am at my wits end, and asking for help on behalf of a "client" who I am
> essentially doing Pro Bono work for.
>
> This is running on Lasso 8.5, OS X 10.6 (I think) on a shared hosted server
> at Point in Space.
>
> The site has an existing function to send bulk emails to its members using
> pre-designed templates.  The problem occurs when they try to send the bulk
> emails with an attachment.  Lasso will send 20 or so of the 200 emails
> before timing out, and in the process completely bogging down the server.
>
> My work around was to add the bulk email script to the Lasso Event Queue as
> a Scheduled Event.  This worked wonderfully when I scheduled the event
> through Lasso Admin.  The bulk email script fired off, all 200 emails went
> out, and the system didn't spike at all.
>
> So I setup a small script to automatically add an event to the Event Queue
> with the parameters provided for the bulk email:
>
> var: 'my_date'=(date: (date_add: date_getcurrentdate, -minute=1));
>      inline:
>          -database='site',
>          -table='schedule',
>          -keyfield='id',
>          'date_time_start'=(date_format: ($my_date), -format='%Q %T'),
>          'date_time_end'='3001-01-01 00:00:00',
>          'next_execute'=(date_format: ($my_date), -format='%Q %T'),
>
> 'executeAction'='http://'(server_name)'/office/email_region_event.lasso?
>              FN='$FN
>              '&LN='$LN
>              '&regStatus='$regStatus
>              '&region='$reg
>              '&officer='$officer
>              '&Sender_Name='$Sender_Name
>              '&subject='$subject
>              '&cc='$cc
>              '&footer='$footer
>              '&pa='$pa
>              '&attach='$attach
>              '&att_filepath='$att_filepath
>              '&template='$template
>              '&em='$em
>              '&incoming_name='$incoming_name
>              '&message='$message,
>          'repeat'=0,
>          'restart'=1,
>          'delay'=0,
>          'user'=var('site_un'),
>          'pass'=var('site_pw'),
>          -username=var('admin_un'),
>          -password=var('admin_pw'),
>          -Add;
>
> The event gets added to the Event Queue, but just sits there, and never gets
> run.  If I manually pause, and resume the queue then the event runs as
> expected.
> -------------------------------------------------------
> Seth C Ganahl (501) 282-4867
> Ganahl Consulting ­ Web Applications
> http://www.ganahlconsulting.com/
> [hidden email]
> -------------------------------------------------------
>
>
>
> #############################################################
> This message is sent to you because you are subscribed to
>    the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to:<[hidden email]>
> Send administrative queries to<[hidden email]>

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Events in the Event Queue Not Running

Jonathan Guthrie-3
In reply to this post by Seth Ganahl
On Dec 1, 2013, at 10:37 PM, Seth Ganahl <[hidden email]> wrote:

> The latest attachment they were trying to send was 7.2 MB.  Not terribly
> large.

FWIW a lot of mail servers are still set to reject anything over 5Mb... encoded... which practically means less than 5Mb of real attachment.
Also, whats the extension of the attachment? .zip files and some others will get rejected from some servers regardless of size.

I know it doesn't seem like the issue right now - it seems the issue is getting it added to the queue correctly, but it may also be an issue that is unrelated to the queue.

Jono

----------------------------
Jonathan Guthrie
[hidden email]
@iamjono
LassoSoft Inc.
AIM Chatroom: lassochat
IRC/freenode #lasso


#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Events in the Event Queue Not Running

Bil Corry-3
In reply to this post by Seth Ganahl
I've found the less that I have to interact with the internal sqlite DBs,
the better.  The way I would have set this up is to do the following:

1) create my own mysql table to hold the executeAction
2) setup a script that checks that mysql table for any new actions, and
calls it (via include_url with the nowait option) - it should immediately
mark (lock) all rows it's processing to prevent a second call to this page
triggering the same items
3) manually create an event that calls the script in #2, every X minutes.

That limits the event queue to just one recurring item, vs. dynamically
creating many.


- Bil




On Sun, Dec 1, 2013 at 10:08 PM, Seth Ganahl <[hidden email]>wrote:

> I am at my wits end, and asking for help on behalf of a "client" who I am
> essentially doing Pro Bono work for.
>
> This is running on Lasso 8.5, OS X 10.6 (I think) on a shared hosted server
> at Point in Space.
>
> The site has an existing function to send bulk emails to its members using
> pre-designed templates.  The problem occurs when they try to send the bulk
> emails with an attachment.  Lasso will send 20 or so of the 200 emails
> before timing out, and in the process completely bogging down the server.
>
> My work around was to add the bulk email script to the Lasso Event Queue as
> a Scheduled Event.  This worked wonderfully when I scheduled the event
> through Lasso Admin.  The bulk email script fired off, all 200 emails went
> out, and the system didn't spike at all.
>
> So I setup a small script to automatically add an event to the Event Queue
> with the parameters provided for the bulk email:
>
> var: 'my_date'=(date: (date_add: date_getcurrentdate, -minute=1));
>     inline:
>         -database='site',
>         -table='schedule',
>         -keyfield='id',
>         'date_time_start'=(date_format: ($my_date), -format='%Q %T'),
>         'date_time_end'='3001-01-01 00:00:00',
>         'next_execute'=(date_format: ($my_date), -format='%Q %T'),
>
> 'executeAction'='http://'(server_name)'/office/email_region_event.lasso?
>             FN='$FN
>             '&LN='$LN
>             '&regStatus='$regStatus
>             '&region='$reg
>             '&officer='$officer
>             '&Sender_Name='$Sender_Name
>             '&subject='$subject
>             '&cc='$cc
>             '&footer='$footer
>             '&pa='$pa
>             '&attach='$attach
>             '&att_filepath='$att_filepath
>             '&template='$template
>             '&em='$em
>             '&incoming_name='$incoming_name
>             '&message='$message,
>         'repeat'=0,
>         'restart'=1,
>         'delay'=0,
>         'user'=var('site_un'),
>         'pass'=var('site_pw'),
>         -username=var('admin_un'),
>         -password=var('admin_pw'),
>         -Add;
>
> The event gets added to the Event Queue, but just sits there, and never
> gets
> run.  If I manually pause, and resume the queue then the event runs as
> expected.
> -------------------------------------------------------
> Seth C Ganahl (501) 282-4867
> Ganahl Consulting ­ Web Applications
> http://www.ganahlconsulting.com/
> [hidden email]
> -------------------------------------------------------
>
>
>
> #############################################################
> This message is sent to you because you are subscribed to
>   the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Events in the Event Queue Not Running

Seth Ganahl
In reply to this post by Brad Lindsay
That did it Brad.  Thank you!


On 12/1/13 10:17 PM, "Brad Lindsay" <[hidden email]> did quoth:

> Seth,
>
> Instead of manually adding the event to the database, have you checked
> out the [event_schedule] tag?
> http://www.lassosoft.com/lassoDocs/languageReference/obj/Event_Schedule
>
> This should allow you to programmatically add events to the queue that
> actually get run.
>
> Brad
>
>
>
> On 12/1/13, 4:08 PM, Seth Ganahl wrote:
>> I am at my wits end, and asking for help on behalf of a "client" who I am
>> essentially doing Pro Bono work for.
>>
>> This is running on Lasso 8.5, OS X 10.6 (I think) on a shared hosted server
>> at Point in Space.
>>
>> The site has an existing function to send bulk emails to its members using
>> pre-designed templates.  The problem occurs when they try to send the bulk
>> emails with an attachment.  Lasso will send 20 or so of the 200 emails
>> before timing out, and in the process completely bogging down the server.
>>
>> My work around was to add the bulk email script to the Lasso Event Queue as
>> a Scheduled Event.  This worked wonderfully when I scheduled the event
>> through Lasso Admin.  The bulk email script fired off, all 200 emails went
>> out, and the system didn't spike at all.
>>
>> So I setup a small script to automatically add an event to the Event Queue
>> with the parameters provided for the bulk email:
>>
>> var: 'my_date'=(date: (date_add: date_getcurrentdate, -minute=1));
>>      inline:
>>          -database='site',
>>          -table='schedule',
>>          -keyfield='id',
>>          'date_time_start'=(date_format: ($my_date), -format='%Q %T'),
>>          'date_time_end'='3001-01-01 00:00:00',
>>          'next_execute'=(date_format: ($my_date), -format='%Q %T'),
>>
>> 'executeAction'='http://'(server_name)'/office/email_region_event.lasso?
>>              FN='$FN
>>              '&LN='$LN
>>              '&regStatus='$regStatus
>>              '&region='$reg
>>              '&officer='$officer
>>              '&Sender_Name='$Sender_Name
>>              '&subject='$subject
>>              '&cc='$cc
>>              '&footer='$footer
>>              '&pa='$pa
>>              '&attach='$attach
>>              '&att_filepath='$att_filepath
>>              '&template='$template
>>              '&em='$em
>>              '&incoming_name='$incoming_name
>>              '&message='$message,
>>          'repeat'=0,
>>          'restart'=1,
>>          'delay'=0,
>>          'user'=var('site_un'),
>>          'pass'=var('site_pw'),
>>          -username=var('admin_un'),
>>          -password=var('admin_pw'),
>>          -Add;
>>
>> The event gets added to the Event Queue, but just sits there, and never gets
>> run.  If I manually pause, and resume the queue then the event runs as
>> expected.
>> -------------------------------------------------------
>> Seth C Ganahl (501) 282-4867
>> Ganahl Consulting ­ Web Applications
>> http://www.ganahlconsulting.com/
>> [hidden email]
>> -------------------------------------------------------
>>
>>
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>>    the mailing list Lasso
>> [hidden email]
>> To unsubscribe, E-mail to:<[hidden email]>
>> Send administrative queries to<[hidden email]>
>
> #############################################################
> This message is sent to you because you are subscribed to
>   the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

-------------------------------------------------------
Seth C Ganahl (501) 282-4867
Ganahl Consulting ­ Web Applications
http://www.ganahlconsulting.com/
[hidden email]
-------------------------------------------------------



#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>