Post by TechWizard » Mon Feb 19, 2018 4:49 am

I'm trying to reduce our database size as I'd like to create an email cron job for backing up. I noticed that the sessions table is over 50MB, is this normal?

We're currently running Version 3.0.2.0, and the database has been updated over time going back to pre 1.5. The entire database is 105MB with 15,984 orders, 4,453 products & 5993 customers. Does this database size sound about right? I'd also imagine there is some old junk from previous versions being carried forward.

Thanks,
Richard.

Newbie

Posts

Joined
Sat Jan 13, 2018 9:44 am

Post by IP_CAM » Tue Feb 20, 2018 4:14 am

Well, after 15,984 paid Orders, one can hardly expect, to get much free
assistance around here, when it comes to a matter, not even related
to Opencart, but rather to a Server Environment. Your Hoster would be
the first to ask about this, and check your Site on the popular Website
Testers, by example a Category Page with as many products listed as it
contains, then you at least get an impression on how it works.
Good Luck!
Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by TechWizard » Mon Apr 23, 2018 8:13 pm

Ernie,

Apologies, it was my understanding that OpenCart added data to the session table as it's located in the OpenCart Database? Is this not the case? Excuse my ignorance, personally, I'm relatively new to OpenCart, I should have mentioned this in the original post.

My expectations are not high regarding free help... I was just putting the question out there, not demanding an answer. I thought it could also be of benefit to others should they face a similar query.

We're actually a Charity organisation and do not operate for profit. We promote, maintain, and encourage the preservation of family history records which are transcribed by volunteers and publicised. These orders span over many years and are low value for digitised versions of parish records, inscriptions and other family history related information to help keep the organisation running.

Thank You,
Richard.

Newbie

Posts

Joined
Sat Jan 13, 2018 9:44 am

Post by IP_CAM » Tue Apr 24, 2018 11:40 am

OpenCart added data to the session table as it's located in the OpenCart Database?
Well, I was not aware about this, since I use an older Version, but there have been some topics
about it, as I found out. But it seems to be a potential problem, performance-wise at least, if it blows
up a database like you mentioned. Especially, if the is no default Admin Way to clean old Session Data out.

In latest Software-Developments, the use of Flatfile-DB Storage for such purposes is getting more
popular again, to keep DB's from doing it all by themselfs. But OC obviously decided to go the opposite
way, by also placing OcMod Content into the database, instead of leaving the 'originals' in their own 'place',
like VqMod does it by default.

But I cannot judge, if this will increase or decrease overall Security, since I have not been confronted with
Security Problems so far, despite of the fact, that my Testsites get bombarded on a regular schedule with
all kinds of attempts. Below is an image, showing just some of the linkings used, and I redirect them to
VEGAS, if they wanna play games. And the only 'reaction' is a couple of Messages like shown below,
showing up on the Admin Error Log once in a while, like those:

Code: Select all

PHP Warning:  is_dir() expects parameter 1 to be a valid path, string given in /home/jacobch/www/ebikes_li/shop/system/engine/action.php on line 16
PHP Warning:  is_file() expects parameter 1 to be a valid path, string given in /home/jacobch/www/ebikes_li/shop/system/engine/action.php on line 24
All I know is, that a 'lean' DB works much more efficient, and I even advise people, to remove the few
thousand of surplus Lines, if they don't need all those Countries and Zones, beeing part of an OC DB
by default. I checked on of my Test DB's, it contains 2'000 Products, and it's a ~7.5 MegaByte
Download, as fully installable Copy.

Still, 105MB to handle in a busy Environment is not just an easy Job, and I would like to get an Idea, by
testing a 20 product category Page by Use of GTMetrix, to see, how your baby works, in general. And
if you're below a 90 / 87 Result, you will have to work on the System anyway, to at least
get everything else to play their part, to result in a speedy Place. A 98 / 90 Result is possible, if a
System is working well. Mobile test Results will usually be 4-6 points less in Load Performance tests,
by use of default like OC Bootstrap3 Themes.

But I could not be of help, whan it comes to find solutions, since most Mods I know of will not work with
latest OC Version anyway. And not much chances exist, to get much free knowledge on such around here,
latest Version Development always has to generate some income first, or the OC-System, as it exists,
would not function.

It was your decision, to select the Version you use. So, better don't blame anybody else, it's usually a
little more expensive, to belong to the Forerunners, one reason, Apple is so rich and famous! :laugh:
Good Luck ;)
Ernie
---
Image

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by TechWizard » Sat Apr 28, 2018 9:32 pm

Ernie,

Thank you for your comprehensive response. For our purposes, the performance of the shop is sufficient, here is the gmetrix report:
https://gtmetrix.com/reports/midland-an ... p/AxEcKs5F

My question wasn't really related to performance, but to the size of the table, because I wanted to reduce the overall database size for backup purposes. I think you misunderstand my intentions, I'm not here to blame anyone, I'm not expecting 'free' support, I'm just asking a simple question about OC v 3.0 in the OC 3.0 forums. I believe you have answered this, as your test install with 2,000 products had a relatively smaller table. So thank you for this, I can now therefore assume mine is bloated and I shall investigate further.

As an aside. I chose to upgrade from version 2.x because version 3.x was available and has been active for almost a year now. We have been using OpenCart since version 1.5 (or maybe earlier, I do not recall), and updated to each new version 6 months or so after it was released. For our usage, there haven't been any issues with this, and this isn't really an issue for us, it was just a query. Version 3.0 is actually perfect for our needs.

We are really grateful to those behind the OpenCart project as it has given us a new way to engage with our customers and help sustain our non-profit organisation.

Newbie

Posts

Joined
Sat Jan 13, 2018 9:44 am

Post by IP_CAM » Sun Apr 29, 2018 3:49 am

3.x was available and has been active for almost a year ...
Well, I was not complaining about, you using OC v.3.x, a Version, going trough a hole bunch of changes,
to reach it's ~ 6th. release since June 2017. This also under the aspect, that the OC Future can only be the
Cloud, with all the consequences, related with/to such Tasks.

Unfortunately, it's the Number ONE widely spread problem , that so many Users always expect latest
Releases to already have been tested by Masses of Pro Users, and therefore much better than anything
else before. It happen with every MS Version, every Phone, Car, and everything else, attracting it's potential
Clientele. But OpenCart comes for free, they therefore cannot afford, to invest great amounts of time and
manpower into A - Z tests. It's a Business Software, after all, and none of them run's a large online Business,
so, they leave this to those, eager and willing to play the free Game, as well as their Role in it. It a Business
Model, and it even works, as OC proves for some Years already.

So, better don't take it personal, that you so far did not receive anything useful on Replies to your specific
Problem. Most others, using OC-3.x, are not even aware about, that this Session Table 'Construction' exists,
and what purpose it serves, in the first place. And Insiders first try to make a Buck, before they start to share
their knowledge on latest Versions with all those, also just waiting, to make a Buck ... 8)
Regardless of, into wich account the money goes... ;)

But if one has a problem with this, one could always use a former Version, to not be confronted with it.
That's what I meant, by mentioning Versions in the first place. But since multiple Visitors will read this,
I usually tend to 'broaden' some things up a little. One could also call it 'social media marketing', kind of... :D
Since one never knows, as old Fellow, in today's times, one might get a second life ...

Good Luck!
Ernie
---

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by JNeuhoff » Mon Apr 08, 2019 1:46 am

This is a known issue caused by OpenCart, it doesn't call the Session.gc method for clearing the 'oc_session' table off old entries, hence this DB table gets bloated. See https://github.com/opencart/opencart/is ... -480609923 for a quick bugfix.
Last edited by JNeuhoff on Mon Apr 08, 2019 8:03 pm, edited 1 time in total.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by letxobnav » Mon Apr 08, 2019 7:28 am

just set it back to files, the claim that they are more secure in a database is nonsense.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by ocmod.space » Wed Mar 11, 2020 8:43 pm

I made a simple and free extension (OCMOD) to clear sessions older then 1day + gc_maxlifetime seconds: Session Debloater

--
My OC extensions
--
What Do You Care What Other People Think?


User avatar
Newbie

Posts

Joined
Wed Jan 10, 2018 9:30 pm


Post by faca5 » Thu Jan 07, 2021 10:31 pm

Simple solution for clean session data from table "oc_session". No more large session table. You can set interval example: 3 days.
https://www.opencart.com/index.php?rout ... n_id=40961

Izdelava spletne trgovine | Najem spletne trgovine | PHP programiranje


User avatar
New member

Posts

Joined
Wed Aug 27, 2014 7:23 pm

Who is online

Users browsing this forum: OSWorX and 515 guests