Jump to content

Pakistani General Discussions


Recommended Posts

Lekin phir bhi, it takes full-working-days, tumhain studies se dheyan hatana parega plus tum abhi itnay expert nahi ho k scripting k sath sath server performance ko b set rakho. Tumhain abhi scripting ati ho gi, maybe tum professional scripter ho lekin professionals bhi har maan jatay hain jab server performance kharab hoti hai.

Maine Arran se server performance ki classes li theen, believe me its really hard to maintain it.

Link to comment
  • Replies 194
  • Created
  • Last Reply

Top Posters In This Topic

Well, I never give up. I'm a well rounded, self-esteem person.

If Arran did those performance classes, then how is it impossible for us to do it? I don't know why people think Arran a creature that only he can do everything well.

You should know ke wohi akela player hai jis ne akelay 1 server ko 3 saloon se top par rakha hai, is ke pechay kuch reasons hain, wo zyada focus script ki performance par karta hai. Maine usay 1000+ lines long script di jis par community ne 100+ positive votes kiye thay, us ne semi-accept kar k mujhay bataya k dekhnay main script outstanding bhi ho lekin wo server ki performance ko kharab karti hai.

Acha performance k related 1 simple question hai, tum database ko kesay use kartay ho server main? Yani entries update kesay kartay ho etc etc?

Han aur ryan, muje server performance aati hai

EDIT : Mera experience check kar lo bas scripting seekhny ka dil nahi karta tha baqi saqb kuch seekha hai 2008 say MTA player hun

Apni server performance experience ke related meray sawal ka jawab do:

Acha performance k related 1 simple question hai, tum database ko kesay use kartay ho server main? Yani entries update kesay kartay ho etc etc?

Link to comment
Acha performance k related 1 simple question hai, tum database ko kesay use kartay ho server main? Yani entries update kesay kartay ho etc etc?

Jitne ziada database banao gay utni hi ziyda performance kharab hogi. So you should make one file of a database, and store all the values or strings in it. Then in other resource, if you want to update the entries you must have to use the export functions to update the values, strings, and also get in contact of the database you've created.

Link to comment
Main ALTER TABLE use karunga for updating the existing column. Aur 1 minute main 1000 entries = 1000 tables obviously.

Is tarha ke heavy database ke liye heavy system bhi hona zaroori hai.

Probably that will ruin the performance even at good VPS hosts like CIT's.

The correct answer was that you should make local tables in server side:

dbTableName = { 
"dbColumn, entry", 
"dbColumn, entry", 
} 

This way, when script starts, call whole database table onResourceStart()

-- I'll assume you have got a db table via dbQuery on resource start and name is table{} 
for k, v in pairs(table) do 
    dbTableName[#dbTableName+1] = k..", "..v 
end 
  

Is tarha you have same entries as of database table but in local table within serverside, now you may call this table a 1000 times, this wont affect the performance, then onResourceStop, do this:

-- I'll assume that you have dropped table from database file by 'DROP TABLE IF EXISTS' statement... 
-- Now you can call the dbTableName{} and save its entries by this: 
  
for k, v in pairs(dbTableName) do 
    local val = split(v, ", ") 
    dbExec( connection, "INSERT INTO table_name VALUES (?,?)", val[1], val[2] ) 
end 
  

This is called simple callBack, you just used dbExec two times within script and see, you have the same entries in dbTable plus server performance won't be affected even at poor VPS hosts and with 100 db calls a minute :)

I hope that helped you with performance issues, there are tons of more issues like this...

Link to comment

I don't guess this would be a big deal because you've used the same procedure at the next part.

Anyways, thank you for your opinion. I never learned anything unless I performed it. So I must step forward and do it in-order to discover the solutions to problems.

EDIT: I guess there is no purpose for hosting a server in MTA:SA, but still I will think about it.

Link to comment
I don't guess this would be a big deal because you've used the same procedure at the next part.

Compare your 'ALTER TABLE' sample with my pseudo using ingame performance browser, you'll see a huge difference if you call your sample 1000 times versus mine.

Local tables won't even affect a single unit while 1000 entries call on each dbQuery would probably cause huge lag.

Link to comment

I considered your code correct. There is nothing to be compared about, as you've put the correct way of storing tables in a variable.

Well, I will of course buy a VPS as soon as possible. Specs of server would be: 4GB RAM, 4 core CPU and 40GB SSD. I guess these specs are fine for now, as we can increase them when needed.

I have many memberships in these kind of tut websites.

Agar mujhy kuch na aye to tum ho na yar. Chalo aik try marte hain. Giving it a try won't harm us! :wink:

Link to comment
  • 4 months later...
  • 5 months later...
  • 1 year later...
  • 3 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...