Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: IMPLEMENTING SESSIONS WITHIN COPPERMINE  (Read 9112 times)

0 Members and 1 Guest are viewing this topic.

laurent

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
IMPLEMENTING SESSIONS WITHIN COPPERMINE
« on: January 02, 2004, 07:28:12 pm »

Hi all,

first I wish you all all the best for this new year.

Ok, so let start now.
I discovered coppermine few weeks ago and had a deep look to the code. I was very please to see that clean codes still exist! I noticed that few variables such as config parameters, account parameters and few others are initiated by the "init.inc.php". This include is included in most of pages so the parameters are available.

The "init.inc.php" call at least 6 database queries. It means that each time a page is loaded, those 6 queries are performed. It obviously means that you have at least 6 queries in all pages. Why didn't you use the sessions instead? Is it for historical reasons (sessions weren't implemented  within PHP when coppermine was first released) or other?

I mean by that if we use sessions variables to store config and account parameters, it could be done only once per session. Let say a visitor who is visiting 50 pages (index, album index and 48 pictures) you would save 300 queries.

Do you plan to implement sessions in the future? I would be glad to do it as part of the devellopers team. Let me know if you are interested.

Kind Regards,

Laurent Sicard
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
IMPLEMENTING SESSIONS WITHIN COPPERMINE
« Reply #1 on: January 02, 2004, 07:39:05 pm »

Laurent,

thanks for the offer, every helping hand is appreciated. As coppermine.sf.net is a quite young project we haven't made up our minds yet on dev team membership policy, so I suggest you just do a cvs devel branch checkout and have a look at what's there yet.

Thumbsup :D

GauGau
Logged

hyperion

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 1317
  • - retired -
IMPLEMENTING SESSIONS WITHIN COPPERMINE
« Reply #2 on: January 03, 2004, 05:03:56 pm »

This woud certainly help speed up Coppermine and prevent DB overuse problems for larger implementations.
Logged
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(http://www.mozilla.org/products/firefox/buttons/getfirefox_small.png)

Tarique Sani

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
IMPLEMENTING SESSIONS WITHIN COPPERMINE
« Reply #3 on: January 03, 2004, 05:13:04 pm »

Hmm... Well sessions might speed up things OR might not - lets see some code and real life bench marks
Logged
SANIsoft PHP applications for E Biz

hyperion

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 1317
  • - retired -
IMPLEMENTING SESSIONS WITHIN COPPERMINE
« Reply #4 on: January 03, 2004, 05:18:40 pm »

True, Tarique.  I know you have an aversion to sessions.  :D
Logged
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(http://www.mozilla.org/products/firefox/buttons/getfirefox_small.png)

Tarique Sani

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
IMPLEMENTING SESSIONS WITHIN COPPERMINE
« Reply #5 on: January 03, 2004, 05:26:04 pm »

Quote from: "hyperion"
True, Tarique.  I know you have an aversion to sessions.  :D

No I don't have aversion to sessions - in fact as one of the core devs of PHPlib I have been using sessions since the time they were not available in PHP :D
Logged
SANIsoft PHP applications for E Biz

hyperion

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 1317
  • - retired -
IMPLEMENTING SESSIONS WITHIN COPPERMINE
« Reply #6 on: January 03, 2004, 06:00:21 pm »

My mistake then.  :lol:  

Perhaps I should say you have a cautious approach to sessions?  :D
Logged
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(http://www.mozilla.org/products/firefox/buttons/getfirefox_small.png)

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
IMPLEMENTING SESSIONS WITHIN COPPERMINE
« Reply #7 on: January 04, 2004, 12:03:48 am »

[list=1]...especially since there might be two issues on sessions:
  • backward compatibility
  • user confusion and support questions[/list:o]I agree with Tarique: let's see the code and decide then if it will go into the coppermine core or will be an add-on.

    @laurent: don't get discouraged by this discussion, it's sort of dev-talk - no need to be nice just for the sake of it; if a decision needs to be made on the general way coppermine is going to take, it's not a matter of personal preferences, but global arcitecture as well as common sense... Please go ahead and code your session mod!

    GauGau
Logged

Tarique Sani

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
IMPLEMENTING SESSIONS WITHIN COPPERMINE
« Reply #8 on: January 04, 2004, 05:20:00 am »

@laurent : just to repeat Gaugau - don't get put off by my (or any other devs) comments, Just that we have to keep the 1000's of users in mind whenever we change any thing in core.

Also how about looking into a better Auth scheme with sessions (since you are going to put in sessions anyways :)
Logged
SANIsoft PHP applications for E Biz

laurent

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
IMPLEMENTING SESSIONS WITHIN COPPERMINE
« Reply #9 on: January 05, 2004, 03:31:31 pm »

Hi guys.

No don't worry I won't get discourage by such a discussion. When I got some ideas in mind.....I never give Up. The fact is that my first post was to let you know that I think that the use of sessions woul be a great improvement in Coppermine security and performance. I am currently analyzing what would be involved in such that devellopment.

Gaugau has the point: would it be a core change or just an add-on (module). My decision would be to go with some core changes in the code since coding it as a module would have the result I try to avoid (more control loop and more queries and more.....)

I can ensure tarique that yes, performances will be improved (database less solicited) I have no doubt on that, I will give you the bench.

I'm on it but it could take a while since I have many others dev on the hand and a Job.

I'm glad to see that this feature interests some people who are consciensious that it could be a great improvement...for now and the future.

I apologize for my unperfect english since I'm a French guy...in Montreal.

   Laurent
Logged

epsilon

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 95
    • http://www.cremita.com
Yeah! This is cool!!! YEAH I NEED YOUR ADDON!!!
« Reply #10 on: January 08, 2004, 03:13:01 am »

My site have 10.000 unique visitors per day and 28.000 impressions, and my cpu and ram is at 99% by te sql requests, sometime i get the error (too many connections to mysql) i think that this is the solution of my problem, i wanna be your beta tester, please contact with my laurent, you have my messenger (epsilonz@msn.com) add me, i wanna talk with you. Please do it...
Logged

laurent

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
IMPLEMENTING SESSIONS WITHIN COPPERMINE
« Reply #11 on: January 08, 2004, 03:34:37 pm »

Ok I added you in my contact list. SO now I'm waiting for you to be online.
Could you give me the website address.

Whoever is interested to help is welcome. I'm currently analyzing the whole code, and want to make global improvements in one aim:
IMPROVE PERFORMANCES, AND TO AVOID UNNECESSARY SQL REQUEST OR CRAZY CONTROL LOOPS (and believe me there are a lot of them)

Kind Regards,

Laurent SIcard
Logged
Pages: [1]   Go Up
 

Page created in 0.03 seconds with 20 queries.