Issue with upload.php with many albums Issue with upload.php with many albums
 

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]

Main Menu

Issue with upload.php with many albums

Started by dke, February 19, 2008, 08:05:46 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dke

Hello,

I understand this might be confusing as i post this in the misc section and not the upload section, but i'm not having trouble with the upload process, only a issue with the upload.php script.

I have over 2000 albums in my gallery and the query generated by the upload script can take up to a minute to load just to bring up the page.

Is there anyway to get around this, when i use "Jupload" i get that page to load in less then 0.2 seconds.

Here is a debug from upload.php (check query number)

USER:
------------------
Array
(
    [ID] => myid
    [am] => 1
    [lang] => english
    [lap] => 19
    [sort] => da
    [liv] => Array
        (
            [0] => 380594
            [1] => 461487
            [2] => 168502
            [3] => 156456
            [4] => 153807
        )

    [search] => Array
        (
            [search] => feathertickle
            [album] => search
            [title] => on
            [newer_than] =>
            [caption] => on
            [older_than] =>
            [filename] => on
            [params] => Array
                (
                    [title] => on
                    [caption] => on
                    [filename] => on
                )

        )

)

==========================
USER DATA:
------------------
Array
(
    [user_id] => 1
    [user_name] => dke
    [groups] => Array
        (
            [0] => 1
        )

    [disk_max] => 0
    [disk_min] => 0
    [can_rate_pictures] => 1
    [can_send_ecards] => 1
    [ufc_max] => 0
    [ufc_min] => 0
    [custom_user_upload] => 0
    [num_file_upload] => 1
    [num_URI_upload] => 0
    [can_post_comments] => 1
    [can_upload_pictures] => 1
    [can_create_albums] => 1
    [has_admin_access] => 1
    [pub_upl_need_approval] => 0
    [priv_upl_need_approval] => 0
    [group_name] => Administrators
    [upload_form_config] => 0
    [group_quota] => 0
    [can_see_all_albums] => 1
    [group_id] => 1
)

==========================
Queries:
------------------
Array
(
    [0] => SELECT extension, mime, content, player FROM cpg147_filetypes; (0.001s)
    [1] => select * from cpg147_plugins order by priority asc; (0s)
    [2] => delete from `coppermine`.cpg147_sessions where time<1203443808 and remember=0; (0s)
    [3] => delete from `coppermine`.cpg147_sessions where time<1202237808; (0s)
    [4] => select user_id from `coppermine`.cpg147_sessions where session_id=md5("myid"); (0s)
    [5] => select user_id as id, user_password as password from `coppermine`.cpg147_users where user_id=1 (0s)
    [6] => SELECT u.user_id AS id, u.user_name AS username, u.user_password AS password, u.user_group+100 AS group_id FROM `coppermine`.cpg147_users AS u INNER JOIN `coppermine`.cpg147_usergroups AS g ON u.user_group=g.group_id WHERE u.user_id='1' (0s)
    [7] => SELECT user_group_list FROM `coppermine`.cpg147_users AS u WHERE user_id='1' and user_group_list <> ''; (0s)
    [8] => SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, MAX(num_URI_upload) as num_URI_upload, MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, MAX(can_create_albums) as can_create_albums, MAX(has_admin_access) as has_admin_access, MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval FROM cpg147_usergroups WHERE group_id in (1) (0s)
    [9] => SELECT group_name FROM  cpg147_usergroups WHERE group_id= 1 (0s)
    [10] => update `coppermine`.cpg147_sessions set time='1203447408' where session_id=md5('fe66adc09fddfa059c40aea22e083d94e81b5583c7e03abc1af76e03f87e1a21'); (0s)
    [11] => SELECT user_favpics FROM cpg147_favpics WHERE user_id = 1 (0s)
    [12] => DELETE FROM cpg147_banned WHERE expiry < '2008-02-19 19:56:48' (0s)
    [13] => SELECT * FROM cpg147_banned WHERE (ip_addr='192.168.0.2' OR ip_addr='192.168.0.2' OR user_id=1) AND brute_force=0 (0s)
    [14] => SELECT aid, title FROM cpg147_albums WHERE category < 10000 ORDER BY title (0.02s)
    [15] => SELECT aid, title FROM cpg147_albums WHERE category='10001' ORDER BY title (0.001s)
    [16] => DELETE FROM cpg147_temp_data WHERE timestamp < 1203443808 (0s)
    [17] => SELECT COUNT(*) FROM cpg147_pictures WHERE approved = 'NO' (0.232s)
    [18] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='119' AND cat.cid=alb.category (0s)
    [19] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='63' AND cat.cid=alb.category (0s)
    [20] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='64' AND cat.cid=alb.category (0s)
    [21] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='65' AND cat.cid=alb.category (0s)
    [22] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='135' AND cat.cid=alb.category (0s)
    [23] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='136' AND cat.cid=alb.category (0s)
    [24] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='33' AND cat.cid=alb.category (0s)
    [25] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='140' AND cat.cid=alb.category (0s)
    [26] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='151' AND cat.cid=alb.category (0s)
    [27] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='26' AND cat.cid=alb.category (0s)
    [28] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='118' AND cat.cid=alb.category (0s)
    [29] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='44' AND cat.cid=alb.category (0s)
    [30] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='2847' AND cat.cid=alb.category (0s)
    [31] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='2848' AND cat.cid=alb.category (0s)
    [32] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='2849' AND cat.cid=alb.category (0s)
    [33] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='2850' AND cat.cid=alb.category (0s)
    [34] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='2851' AND cat.cid=alb.category (0s)
    [35] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='2852' AND cat.cid=alb.category (0s)
    [36] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='846' AND cat.cid=alb.category (0s)
    [37] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='35' AND cat.cid=alb.category (0s)
    [38] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='2434' AND cat.cid=alb.category (0s)
    [39] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='2415' AND cat.cid=alb.category (0s)
    [40] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='2413' AND cat.cid=alb.category (0s)
    [41] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='2414' AND cat.cid=alb.category (0s)
    [42] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='2416' AND cat.cid=alb.category (0s)
    [43] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='61' AND cat.cid=alb.category (0s)
    [44] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='48' AND cat.cid=alb.category (0s)
    [45] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='165' AND cat.cid=alb.category (0s)
    [46] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='150' AND cat.cid=alb.category (0s)
    [47] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='94' AND cat.cid=alb.category (0s)
    [48] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='52' AND cat.cid=alb.category (0s)
    [49] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='2535' AND cat.cid=alb.category (0s)
    [50] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='36' AND cat.cid=alb.category (0s)
    [51] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='45' AND cat.cid=alb.category (0s)
    [52] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='180' AND cat.cid=alb.category (0s)
    [53] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='182' AND cat.cid=alb.category (0s)
    [54] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='183' AND cat.cid=alb.category (0s)
    [55] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='184' AND cat.cid=alb.category (0s)
    [56] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='185' AND cat.cid=alb.category (0s)
    [57] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='186' AND cat.cid=alb.category (0s)
    [58] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='187' AND cat.cid=alb.category (0s)
    [59] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='188' AND cat.cid=alb.category (0s)
    [60] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='211' AND cat.cid=alb.category (0s)
    [61] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='190' AND cat.cid=alb.category (0s)
    [62] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='2782' AND cat.cid=alb.category (0s)
    [63] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='2784' AND cat.cid=alb.category (0s)
    [64] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='2905' AND cat.cid=alb.category (0s)
    [65] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='2906' AND cat.cid=alb.category (0s)
    [66] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='3113' AND cat.cid=alb.category (0s)
    [67] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='3114' AND cat.cid=alb.category (0s)
    [68] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='3115' AND cat.cid=alb.category (0s)
    [69] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='191' AND cat.cid=alb.category (0s)
    [70] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='192' AND cat.cid=alb.category (0s)
    [71] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='193' AND cat.cid=alb.category (0s)
    [72] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='194' AND cat.cid=alb.category (0s)
    [73] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='195' AND cat.cid=alb.category (0s)
    [74] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='196' AND cat.cid=alb.category (0s)
    [75] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='197' AND cat.cid=alb.category (0s)
    [76] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='198' AND cat.cid=alb.category (0s)
    [77] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='199' AND cat.cid=alb.category (0s)
    [78] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='200' AND cat.cid=alb.category (0s)
    [79] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='201' AND cat.cid=alb.category (0s)
    [80] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='202' AND cat.cid=alb.category (0s)
    [81] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='203' AND cat.cid=alb.category (0s)
    [82] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='204' AND cat.cid=alb.category (0s)
    [83] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='205' AND cat.cid=alb.category (0s)
    [84] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='206' AND cat.cid=alb.category (0s)
    [85] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='207' AND cat.cid=alb.category (0s)
    [86] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='208' AND cat.cid=alb.category (0s)
    [87] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='209' AND cat.cid=alb.category (0s)
    [88] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='210' AND cat.cid=alb.category (0s)
    [89] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='212' AND cat.cid=alb.category (0s)
    [90] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='213' AND cat.cid=alb.category (0s)
    [91] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='214' AND cat.cid=alb.category (0s)
    [92] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='215' AND cat.cid=alb.category (0s)
    [93] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='216' AND cat.cid=alb.category (0s)
    [94] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='217' AND cat.cid=alb.category (0s)
    [95] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='218' AND cat.cid=alb.category (0s)
    [96] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='219' AND cat.cid=alb.category (0s)
    [97] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='220' AND cat.cid=alb.category (0s)
    [98] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='221' AND cat.cid=alb.category (0s)
    [99] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='222' AND cat.cid=alb.category (0s)
    [100] => SELECT cat.name FROM cpg147_categories cat, cpg147_albums alb WHERE alb.aid='223' AND cat.cid=alb.category (0s)

-------------------- -------------------- -------------------- --------------------
---------- QUERIES GOES ON TO 2500 + TO LONG TO POST --------------------
-------------------- -------------------- -------------------- --------------------
)

==========================
GET :
------------------
Array
(
)

==========================
POST :
------------------
Array
(
)

==========================
VERSION INFO :
------------------
PHP version: 5.2.5 - OK
------------------
mySQL version: 5.0.45-community-nt
------------------
Coppermine version: 1.4.16(stable)
==========================
Module: GD
------------------
GD Version: bundled (2.0.34 compatible)
FreeType Support: 1
FreeType Linkage: with freetype
T1Lib Support: 1
GIF Read Support: 1
GIF Create Support: 1
JPG Support: 1
PNG Support: 1
WBMP Support: 1
XPM Support:
XBM Support: 1
JIS-mapped Japanese Font Support:

==========================
Module: mysql
------------------
MySQL Supportenabled
Active Persistent Links 0
Active Links 1
Client API version 5.0.45
==========================
Module: zlib
------------------
ZLib Support enabled
Stream Wrapper support compress.zlib://
Stream Filter support zlib.inflate, zlib.deflate
Compiled Version 1.2.3
Linked Version 1.2.3
==========================
Server restrictions (safe mode)?
------------------
Directive | Local Value | Master Value
safe_mode | Off | Off
safe_mode_exec_dir | no value | no value
safe_mode_gid | Off | Off
safe_mode_include_dir | no value | no value
safe_mode_exec_dir | no value | no value
sql.safe_mode | Off | Off
disable_functions | no value | no value
file_uploads | On | On
include_path | .;C:\php5\pear | .;C:\php5\pear
open_basedir | no value | no value
==========================
email
------------------
Directive | Local Value | Master Value
sendmail_from | xxxxxxxxx@bredband.net | xxxxxxxxxx@bredband.net
sendmail_path | no value | no value
SMTP | xxxx.bredband.net | xxxx.bredband.net
smtp_port | 25 | 25
==========================
Size and Time
------------------
Directive | Local Value | Master Value
max_execution_time | 300 | 300
max_input_time | 120 | 120
upload_max_filesize | 30M | 30M
post_max_size | 30M | 30M
==========================
Page generated in 1.501 seconds - 2894 queries in 0.283 seconds - Album set : ; Meta set: ;


I cannot recreate the slow load issue, but this time you can see it was fast (1.501 seconds) other times when i've unfortuantly had debug of it has been over 1 minute and i believe its the first time after the database has been restarted (i guess once those scripts are loaded they are in memory?)

Is this suppose to happen or is something else maybe wrong making upload.php run slow on occasions?

Nibbler

That's normal. There's more efficient code in 1.5, which you can try to backport if you like.

http://coppermine.svn.sourceforge.net/viewvc/coppermine/trunk/cpg1.5.x/upload.php?r1=4131&r2=4163

No questions about when 1.5 will be released...

dke