We have created a SaaS app using cakephp 1.3 which is pulling in data from a 3rd party API and populating the database (each subdomain has its own database) . We are in process of moving our architecture to a gearman for the 3rd party API. Each subdomain would submit a workload to the queue and corresponding worker (multiple instances of the same workers exists simultaneously) would execute it. I've written the worker using the same code base and do just switch the db connection details on the fly. This work alright when the worker instance(s) are dealing with one subdomain connection details at a given time. My problem is that if more than one workload is from different subdomains are being served by the gearman workers in parallel,some of the data fetched from one subdomain ends up being in the other subdomain. The db config is probably being switched because of the underlying cakephp core cache? Singleton?
I was wondering if its the case. Its kinda a difficult debugging what the issue is. It would be immensely helpful if you could throw me some pointers.
> -- > You received this message because you are subscribed to the Google Groups "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
> On Sat, Sep 15, 2012 at 6:46 PM, Ketan Shah <ketan.s...@gmail.com> wrote:
> > Thats correct. I am sending the db config info in the workload
> Paste the code that you are using to change the DB
> This should not happen because every workload is processed in its own
> thread and they do not share anything. The DB connection should not
> get cached
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
-- "If you don't risk anything in life, you are risking even more"
> On Mon, Sep 17, 2012 at 10:10 AM, Dr. Tarique Sani <tariques...@gmail.com>
> wrote:
>> On Sat, Sep 15, 2012 at 6:46 PM, Ketan Shah <ketan.s...@gmail.com> wrote:
>> > Thats correct. I am sending the db config info in the workload
>> Paste the code that you are using to change the DB
>> This should not happen because every workload is processed in its own
>> thread and they do not share anything. The DB connection should not
>> get cached
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com.
>> To unsubscribe from this group, send email to
>> cake-php+unsubscribe@googlegroups.com.
>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> --
> "If you don't risk anything in life, you are risking even more"
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
-- =============================================================
PHP for E-Biz: http://sanisoft.com =============================================================
I've wasted too much time only to realise that remote mysql connection is
kinda slow. So we decide to build an API on top of cakephp which would
consume this data. Worked out to be lot faster.
cheers,
-Ketan.
On Mon, Sep 17, 2012 at 3:41 PM, Dr. Tarique Sani <tariques...@gmail.com>wrote:
> > On Mon, Sep 17, 2012 at 10:10 AM, Dr. Tarique Sani <
> tariques...@gmail.com>
> > wrote:
> >> On Sat, Sep 15, 2012 at 6:46 PM, Ketan Shah <ketan.s...@gmail.com>
> wrote:
> >> > Thats correct. I am sending the db config info in the workload
> >> Paste the code that you are using to change the DB
> >> This should not happen because every workload is processed in its own
> >> thread and they do not share anything. The DB connection should not
> >> get cached
> >> You received this message because you are subscribed to the Google
> Groups
> >> "CakePHP" group.
> >> To post to this group, send email to cake-php@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> cake-php+unsubscribe@googlegroups.com.
> >> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> > --
> > "If you don't risk anything in life, you are risking even more"
> > ---
> > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com.
> > To unsubscribe from this group, send email to
> > cake-php+unsubscribe@googlegroups.com.
> > Visit this group at http://groups.google.com/group/cake-php?hl=en.
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
-- "If you don't risk anything in life, you are risking even more"