CodeIgniter keeping session alive via session_time_to_update - codeigniter

I want to keep sessions alive for an extended period of time for peoples shopping carts, and was wondering if its a good idea to do so by setting the session_time_to_update variable in the config file to the desired time (i.e. 6 months).
I changed it to 7200 seconds at the moment and can see that I am still logged in after 5 minutes (it was 300 seconds by default).

Related

Heroku Scheduler "Next Due" time keeps increasing

I'm working on using Heroku's Scheduler add-on (node-cron doesn't seem to be working for me). I installed the add-on and added a new job (set its frequency to every 10 minutes). However, the job never seems to execute. Upon further inspection, I found that the "next due" time keeps increasing.
In other words, let's say the current time is 1:00. The next due time should be (and is) 1:10. 5 minutes later, the current time is 1:05. Even though the next due time should still be 1:10, it changes to 1:15 (basically always being 10 minutes ahead of current time). How do I fix this?

Visual studio load test simulate multiple users with one user

I have a webtest in visual studio, which login to a website and does few clicks. I wanted to simulate this for 2000 users without having those many logins in a csv file or a database. Configured my webtest to run the test for 30 minutes by stepping 10 users every 10 seconds, its running fine for like 2 minutes and then failing after that with multiple errors. Is this possible at all ? If so how can i do this ?
A load test is intended to do what is stated in your question but there is too little detail in the question to give a good answer. Adding 10 users every 10 seconds means that after 2 minutes there have been 2*60/10 = 12 increments, so 10(users) * 2(minutes) * 60(seconds per minute) / 10(step duration) = 120 users. If it ran for the full 30 minutes then there would be 10*30*60/10 = 1800 users. Microsoft provide recommendations for how many users can be run by one computer and when to use additional agent computers. These are just starting points and do not take the details of the individual tests into account.
Rather than jumping in with a 2000 user test it may be better to start more slowly and establish, for a modest number of users that, the test suite works and also that the web site works. I suggest rerunning the test incrementing by 10 users every minute. Then after 2 minutes there will be 10*2*60/10 = 120 users. If that test works then decrease the step interval to (perhaps) 20 seconds.
The question does not state what errors are being generated. The actual errors need to be analyzed to determine the nature and location of the problem. It may be that a limit is being reached in some part of the server, the network or the computer running the test. When the limiting component is found then you know what needs changing.

Pooling Not Reusing INACTIVE Sessions

This is a general question about flow -
Lately we started getting warnings by .Net of Connection timeout or Connection must be open for this operation.
We are working with Oracle DB and we set a job running every 5 seconds, counting how many connections are there (both ACTIVE and INACTIVE) by the w3wp (we are querying gv$session).
The max pool size for each WS (we have 2) is 300, meaning 600 connections in total.
We noticed that indeed we are reaching the 600 sessions before the crash, however, there are many INACTIVE sessions out of those 600 sessions.
I would except that those sessions would be reused, since they are INACTIVE at the moment.
In addition, the prev_sql_id being running by most of these INACTIVE sessions is: SELECT PARAMETER, VALUE FROM SYS.NLS_DATABASE_PARAMETERS WHERE PARAMETER IN ('NLS_CHARACTERSET', 'NLS_NCHAR_CHARACTERSET').
Is it a normal behavior?
Further more, after recycling, the connection count is of course small (around 30), but 1 minute later it jumps into 200. Again, the majority are INACTIVE sessions.
What is the best way to understand what are these sessions and troubleshoot it?
Thanks!

Do ongoing parse.com requests continue to count against the API limit?

My understanding of the parse.com API rate limit is that it’s not a concurrent-job limit, it’s just the number of requests started in a given second. So if a user is, say, uploading a file from a slow network and it takes 30 seconds, that’s not 1 of my 30 req/s taken up that whole time. It’s just one request, the first second.
On my team, though, is a wonderful security guy whose job it is to worry. He thinks that if 30 users upload a file each, for 30 seconds, at a 30 r/s limit, no one else will be able to use our app until they are done.
Which one is correct?
Your understanding was correct. It's the number of requests started per second. The duration of the request does not come in to play.
Source: I work at Parse.
I think you are right. I've made some experiments with Parse, for example i reloaded a UITableview 10 or 20 times in one second (can't remember) for 3-4 minutes and checked the requests in the admin panel. The maximum value was always less than 30, but it doesn't matter, the point is that you can test it this way and get more informations.
Just create some test project and reload the SampleViewController.m (which contains a Parse query) 30 times in one second, after this you can check the data browser which will display the traffic by req/sec.
As a second option you can upload a bunch of images by current user in every second, since the upload time is longer than 1 sec, you can check what happens when you start uploading a bunch of images (or other data) in every second.

Determining session time for a website

For one of my classes we need to calculate the session length for a user visiting a website. We were given a web log. The web log is in this format:
IPAddress date httpMethod httpStatus size referrer browserInfo
The httpMethod looks like this: GET /include/main_page.css HTTP/1.1
The referrer is always the main page: http://www.cs.myCollage.com or -
I am using a timeout value of 20 minutes.
QUESTIONS:
I am not sure how to tell when a session is over other than when it times out. Is the only way to end a session with a timeout? Is there a way to detect when a user leaves the site (using only the information in the logs)?
This is my current strategy (assume that we have these logs):
IPAddress Time httpMethod ...
IP1 2:15 GET something
IP1 2:17 GET something else
IP1 2:30 GET something else
IP1 4:30 GET something else
IP1 4:32 GET something else
This means that the user has had two sessions. I think that the first session would be either 15 minutes or 35 minutes. Should I include the timeout in the session time?
The second session would be between 2 minutes and 22 minutes.
Timeout value is used to separate different sessions coming from same IP (which is not necessarily the same person). In your example you have two different sessions because period from 2:30 to 4:30 is larger than timeout value.
As for determining session length this is probably straightforward class homework solution, and probably what teacher had in mind: just subtract start time from end time. In your case 15 minutes for first session, and 2 minutes for second.
If this would be a real world project then maybe last page in each session should be given some value too. For this you can use temporal locality approach:
The duration of the last GET could be estimated by average durations of all pages that precede it. In you example (2:15,2:17,2:30) first two pages lasted for 15 minutes, so estimation is that visitor is kinda slow and/or thorough and that third page lasted for 7.5 minutes, and session total is 22.5 minutes. From (4:30,4:32) we deduce that last page lasted for 2 minutes, and session total is 4 minutes. In special case where we have only one page visit you must have some arbitrary value for duration, like 1 minute.
Another approach is to put a value to every page. Some page take more time to read than others. This means you must read the whole log and determine the average visit time for each page when they are in mid session, and use this time for case when page is last in session. This is more complicated, and probably not an answer to your homework question.
Best real world solution would probably be a mix of these two approaches.

Resources