Thread: Chat Modifications - MGC Chatbox Evo
View Single Post
  #6053  
Old 02-27-2010, 01:32 AM
gmerin gmerin is offline
 
Join Date: Dec 2008
Posts: 78
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kronnos View Post
How do you disable ajax and what are the negative side effects of disabling it?

Thanks
in the admincp -> vb options -> General Settings -> Disable Ajax

i'm feeling wordy tonight ; you don't need to read the rest to test disabling some ajax functions.

various features are written using ajax code and js libraries. it allows portions of the page to be updated with data from tables in the database asynchronously (a synchronous database access happens in sync with the refresh of the entire page: as each line of code in the page is interpreted and acted on, database access occurs as the specific line in the code makes the request. asynchronous access occurs without requiring a refresh of the entire page and just for that particular item you are working on at that moment) or out of the normal execution sequence of the code and database access in that page.

An example of an ajax function is when you search for all posts by a board user. you type the beginning of the user name and a drop down window appears with all the entries in the user table that match the characters you've entered to that point. the process makes an asynchronous query to the user table in the database for all the entries where name is like the letters you've entered, without requiring that all the lines in that page before it be interpreted and acted upon first.

various functions are written in ajax to make the overall operation of the board smoother and to require less full page refreshes. the display of the smilies (when you click "More") in the text entry section of the chatbox is an ajax function. when you disable ajax you disable these features and the additional database queries they make.

many users simultaneously accessing ajax features will generate a lot of additional queries, thus loading up the database activity. if your board is the only one accessing the database you probably won't notice the effects of the additional activity. if you share a database instance on an service provider's database server and the system is normally busy the additional activity can impact the database performance and lag your board.

i believe that ajax seems to encourage developers writing code independently and without sufficient concern for the general state of the system. prior to ajax, developers really didn't have to be concerned with concurrent processes because in interpreted procedural code (like php v4) there really isn't concurrent processing. things happen in sequence as dictated by the program organization. in object coding, and especially in ajax processes happen asynchronously but developers often do not check to see what else is going on before they issue their requests. they just assume the system will deal with it, and in the perfect world the OS is supposed to just deal with it, but the world isn't perfect and the hardware always lags behind the OS and programming demands (something that i encounter at work as well: developers are rarely DBAs therefore rarely understand either how the database actually services their code requests or the impact of their code on the database performance).

for example, if i run the Live Topic mod and one or two other ajax coded mods my external, hosted board lags. remove or disable Live Topics and the lag vanishes. too many concurrent database access calls force a sacrifice of performance. things happen slower than we would like. re-writing the code more efficiently is one way to address this except developers are usually busy and under time constraints. another way is to throw hardware at it, except board owners are usually working on shoestring budgets. disabling the problematic code, in this case the ajax functions, is another way and it has no additional costs or resource scheduling issues, but you lose functionality.

you have to pay for it someplace, so you make a choice.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01162 seconds
  • Memory Usage 1,779KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete