Use a database table to store the number of registered users, but you need to come up with some way to limit the time for these users. I would suggest a field in the table that marks their last action. When a new user tries to log in, you need to apply some logic (pseudo-code):
if(<10users){
login
} elseif(any of the users have no activity for 30 mins){
remove that user and login
} else {
inform user of no space
}
, .