Limiting data resources

Author Message

Mauro Innocenti

Friday 25 March 2005 2:41:34 am

I'm testing eZ in a linux box (Apache+PHP+MySQL).

I would want to limit in some way the data resources available to eZ (with limits configurable separately for each siteaccess...).
The scope of this is limiting the amount of data (folders, articles, files, etc.) the users my submit in a single siteaccess.

Thanks for any suggestion.

Bård Farstad

Tuesday 12 April 2005 12:46:52 am

Mauro,

eZ publish has current no function for limiting the amount of data you can insert. To create a limit for this you need to alter the function which creates new objects. This is located in kernel/content/action.php. Search for $class->instantiate(). This is the function which creates the actual object. Here you can add a limitation check to prevent creation of more than x objects.

--bård

Documentation: http://ez.no/doc

Mauro Innocenti

Wednesday 13 April 2005 1:29:41 am

Thank You Bård,
hacking the kernel functions is the powerful solution.

I think an alternate solution is creating a cron script (or adding some stuff to "cronjobs") for testing regularly the resource compsuntion of sites and limiting accordly the roles for users (no creation and no upload).

Anyway, what is Your ideas for the much useful "test or resource usage" for a single siteaccess (filesystem usage, DB usage, cache, ...)?

Xavier Dutoit

Thursday 14 April 2005 7:19:21 am

Hi Mauro,

Could you describe us the scenario of when you'd like to limit the amount of "things" created ?

If this is a commercial limitation (no more than X on the small pack), then I think that the easier to understand is the number of items (articles, folders...).

If this is a technical one, the size is the thing to monitor, then that's probably the size of the uploaded elements (files, images or multimedia) that matters.

Anyway, a not too bad place could be in an event in the publication workflow (before), isn't it ?

X+

http://www.sydesy.com

Mauro Innocenti

Thursday 14 April 2005 7:48:13 am

Hi X,
I want a technical (size) limitation.

My scenario is very similar to a "quota" limit (much like the "user quota" on Linux filesystems), in which I want to limit the total amount of data the users of a single siteaccess may own.
I want to be possible give to my users the equivalent of "max X MB of web space" for single web site.

I must read much carefully the workflow documentation...

Thanks.

Mauro

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 20:13:56
Script start
Timing: Jan 19 2025 20:13:56
Module start 'layout'
Timing: Jan 19 2025 20:13:56
Module start 'content'
Timing: Jan 19 2025 20:13:57
Module end 'content'
Timing: Jan 19 2025 20:13:57
Script end

Main resources:

Total runtime0.6434 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0077 589.1719152.6250
Module start 'layout' 0.00770.0031 741.796939.4453
Module start 'content' 0.01080.6314 781.2422598.8203
Module end 'content' 0.64220.0012 1,380.062512.1719
Script end 0.6434  1,392.2344 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.5588160.0002
Check MTime0.00130.2088160.0001
Mysql Total
Database connection0.00100.159010.0010
Mysqli_queries0.580990.2907650.0089
Looping result0.00070.1075630.0000
Template Total0.609694.820.3048
Template load0.00210.326420.0010
Template processing0.607594.424220.3038
Template load and register function0.00020.037810.0002
states
state_id_array0.00100.150010.0010
state_identifier_array0.00080.118420.0004
Override
Cache load0.00180.2759330.0001
Sytem overhead
Fetch class attribute can translate value0.00080.129730.0003
Fetch class attribute name0.00110.173070.0002
XML
Image XML parsing0.00140.211830.0005
class_abstraction
Instantiating content class attribute0.00000.002170.0000
General
dbfile0.00180.2858230.0001
String conversion0.00000.001640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 20
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs