This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how many data can be set in context ,session ,and request ? 500M is OK ?Thank you!

 
Yajun Zhan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how many data can be set in context ,session ,and request ? 500M is OK ?Thank you!
 
Ellen Zhao
Ranch Hand
Posts: 581
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what's the kind of your context, session and request ?
 
Yajun Zhan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am now building a wireless service system,the system goal is it can service 500,000 people,our system will provide 10,000 items that can be ordered by custom,and each items can be packed in a low price package.
I am now considering load all our items and package into context when our system get start.and every day , our system will automatic reload all items and package into memory to ensure new items and package that have been build will be available to custom. By this way, the wireless custom do not need to request our database to search his/her interest items or package.
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm moving this to the servlets forum, seeing as though the session and request contexts are used in web applications.
As for your question... I can't see anything in the Servlet Specification that defines the size limit, so I think the size of the request and sesion contexts is application server specific -- also depending on the size of the heap you start your app server with.
 
Brahim Bakayoko
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you can if you have the memory.
 
Yajun Zhan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am now considering it is decided by the implement of app server.
If the server depend jvm to allocate memory,so the max heap is default 64M,
if the server depend native os to allocate memory,so the max heap can be 2G,which can be swaped to disk.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do NOT preload all that stuff, rather load it on request only.
Let the database server worry about database performance and updating issues rather than caching everything yourself.
Also consider that your users will most likely never need all ten thousand items, most will want only one or two.
Why reserve memory for 10.000 items per user if they don't need that memory?
Then consider that you can save a lot of memory by not giving each customer a complete object with all info about the product.
Rather give him an object with just a reference to a single object that is shared among users and a number indicating the amount in his shopping cart (and maybe a number indicating the total price if there's customer-specific discounts).
Suddenly you're talking about maybe 1KB needed per customer instead of the 1MB you estimated.
Also consider that not all customers will be online simultaneously so you need not allocate memory for them all.
Don't start your day by creating an array of half a million customer records with 10.000 product records each.
Create customer records on the fly as they log in and assign them only those products they really are interested in.
 
Yajun Zhan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you! Jeroen Wenting
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic