Hey all,

I seem to be having exactly the same problems:

1. Sometimes getting old versions when refreshing a page, while I did
edit file.
- this first I did fix by writing a script that "touches" my wsgi
script when I save a file in my IDE, as read at:
http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode

2. Some kind of caching of certain variables.
- this I dont know how to fix yet, but I got to reproduce the problem
fairly easy with the following code, executed as wsgi script:

import datetime
start = datetime.datetime.now()
def application(environment, start_response):
    start_response('200 OK', [('Content-Type', 'text/html;
charset=utf8')])
    return [str(datetime.datetime.now() - start)]


Exact Problem: Everytime I refresh the url to this page the time
printed grows bigger, if I wait exactly 1 second between 2 refreshes,
the time grows by exactly 1 second, there seems to be no end to it, I
waited 2 days, and it incremented with 2 days more. The moment I touch
the file or restart apache, the time printed is again the first
request parse time, like I need it to be every refresh. The problem
persists in both the mod_wsgi's embedded mode & daemon mode on all my
test boxes seen below.

Initially I was trying to write a simple page request time profiler
class for my homebrew python framework, but I have seen the problem
now in 3 different situations, with or without any framework, also
with a database connection.

I am running:
- Apache/2.2.12 on Ubuntu server 9.10 with mod_wsgi 3.1 in daemon mode
and python 2.6.4.

I am getting exactly the same results on these 2 other systems I
tested on:
- FreeBSD 6.1-RELEASE Apache/2.2.3 with python 2.4.3 and wsgi 3.1 with
same configuration.
- FreeBSD 7.0-RELEASE Apache/2.2.13 with python 2.5.4 and wsgi 3.1
with same configuration.

I am trying to setup a virtual hosting environment on various
application servers with a single source file storage server, but at
this moment I am only hosting 1 application, the problem persists on
all application servers within, I am pretty sure it has nothing todo
with concurrency or smth.


Tnx for all helpfull answers in advance,

Bran

On 30 dec 2009, 11:10, Graham Dumpleton <[email protected]>
wrote:
> I do not know sufficient about Django to understand your issue. As I
> said, you will be better off asking on the mailing list for the
> framework you are using, ie., Django. So, perhaps try:
>
>  http://groups.google.com/group/django-users
>
> Graham
>
> 2009/12/30 saran_ATD <[email protected]>:
>
> > Graham, Thank you for your response. I am not using custom framework.
> > It is just the latest django.
>
> > Here I have an issue, I don't know how to proceed.
> > Here what I have in models.py
> > I have a base class: for example say class base_class(models.Model)
> > In this base class I have definition for a db table, class Meta:
> > abstract = True
> > I have an manager class : class manager_class(models.Manager)
> > In this derived class I coded return reverse functionality
>
> > In view,
> >       I am deriving a new class view_class(base_class)
> >          Here I am setting Class Meta:db_table = my_table.
>
> > In this scenario, my_table is dynamic. Its physical structure is same
> > however, a new table created for every day. Hence, there will be more
> > than one table with same skeleton for every day. When I search for
> > based on date, it should search from corresponding date db table.
> > It is doing it only for the first request. Successive requests it is
> > searching from the same table. (Table name is part build using date
> > which user dynamically enters). I manipulated the table name with used
> > entered date however it is not recognized!!! in consecutive search.
> > When I restart my apache, it fetchs from the request table. How can I
> > tell this code to search from
> > different table for every request. (once again physical structures are
> > the same just one table for every day). In one sentence, When I print
> > the table name it prints correct table name however actual data is
> > fetched from first requested table.
>
> > On Dec 23, 3:55 pm, Graham Dumpleton <[email protected]>
> > wrote:
> >> 2009/12/24 saran_ATD <[email protected]>:
>
> >> > 1) I am using mod_wsgi module to load my python code with Apache.
> >> > However, I am having trouble with reloading the code. whenever I
> >> > modify the code I have to restart my apache. I am using WSGI Daemon
> >> > process load options in WSGI. I though that should solve the reload
> >> > problem. This is not a serious problem compared to that of my other
> >> > issue that I explained in section 2.
>
> >> > WSGIDaemonProcess borg-portal user=atd group=atd processes=1
> >> > threads=25
> >> > WSGIProcessGroup borg-portal
>
> >> > WSGIScriptAlias /borg-portal /home/skannan/borgTraining/atd/borg/
> >> > portal/portal.wsgi
>
> >> Have you read:
>
> >>  http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode
>
> >> > 2) More serious problem I have is when I fetch data from database, it
> >> > cached somewhere in Apache/mod_wsgi and at most of the time, the data
> >> > I see on the screen is different from what I have in database.
> >> > Please help.
>
> >> That is a caching issue for your specific application. If you are
> >> using a framework, then ask on the mailing list for that framework.
>
> >> Otherwise, you are going to have to explain more about what custom
> >> framework you are using.
>
> >> Graham
>
> > --
>
> > You received this message because you are subscribed to the Google Groups 
> > "modwsgi" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to 
> > [email protected].
> > For more options, visit this group 
> > athttp://groups.google.com/group/modwsgi?hl=en.
-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en.


Reply via email to